diff options
author | Gilles Dartiguelongue <eva@gentoo.org> | 2018-11-20 12:12:16 +0100 |
---|---|---|
committer | Gilles Dartiguelongue <eva@gentoo.org> | 2018-11-20 12:13:15 +0100 |
commit | e98de08886fcfdc46109c1d38048247174a9e0ac (patch) | |
tree | 75d526e9c82c9f61b9807068667a723831cdf2d9 | |
parent | gnome-extra/gnome-color-manager: 3.24.0 → 3.30.0 (diff) | |
download | gentoo-e98de08886fcfdc46109c1d38048247174a9e0ac.tar.gz gentoo-e98de08886fcfdc46109c1d38048247174a9e0ac.tar.bz2 gentoo-e98de08886fcfdc46109c1d38048247174a9e0ac.zip |
app-emulation/cloud-init: update gentoo fixes
Package-Manager: Portage-2.3.51, Repoman-2.3.12
Signed-off-by: Gilles Dartiguelongue <eva@gentoo.org>
6 files changed, 208 insertions, 5 deletions
diff --git a/app-emulation/cloud-init/cloud-init-18.4-r1.ebuild b/app-emulation/cloud-init/cloud-init-18.4-r1.ebuild new file mode 100644 index 000000000000..34fd8b7e077a --- /dev/null +++ b/app-emulation/cloud-init/cloud-init-18.4-r1.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +PYTHON_COMPAT=( python2_7 python3_4 python3_5 python3_6 ) + +inherit distutils-r1 + +DESCRIPTION="Cloud instance initialisation magic" +HOMEPAGE="https://launchpad.net/cloud-init" +SRC_URI="https://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="test" + +CDEPEND=" + dev-python/jinja[${PYTHON_USEDEP}] + dev-python/oauthlib[${PYTHON_USEDEP}] + dev-python/pyserial[${PYTHON_USEDEP}] + >=dev-python/configobj-5.0.2[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/requests[${PYTHON_USEDEP}] + dev-python/jsonpatch[${PYTHON_USEDEP}] + dev-python/jsonschema[${PYTHON_USEDEP}] + dev-python/six[${PYTHON_USEDEP}] +" +DEPEND=" + dev-python/setuptools[${PYTHON_USEDEP}] + test? ( + ${CDEPEND} + >=dev-python/httpretty-0.7.1[${PYTHON_USEDEP}] + dev-python/mock[${PYTHON_USEDEP}] + dev-python/nose[${PYTHON_USEDEP}] + dev-python/unittest2[${PYTHON_USEDEP}] + dev-python/coverage[${PYTHON_USEDEP}] + dev-python/contextlib2[${PYTHON_USEDEP}] + ) +" +RDEPEND=" + ${CDEPEND} + net-analyzer/macchanger + sys-apps/iproute2 + sys-fs/growpart + virtual/logger +" + +PATCHES=( + # Fix Gentoo support + # https://code.launchpad.net/~gilles-dartiguelongue/cloud-init/+git/cloud-init/+merge/358777 + "${FILESDIR}"/${P}-fix-packages-module.patch + "${FILESDIR}"/${P}-gentoo-support-upstream-templates.patch + "${FILESDIR}"/${PV}-fix-filename-for-storing-locale.patch + "${FILESDIR}"/${PV}-fix-update_package_sources-function.patch + "${FILESDIR}"/${PV}-add-support-for-package_upgrade.patch +) + +src_prepare() { + # Fix location of documentation installation + sed -i "s:USR + '/share/doc/cloud-init:USR + '/share/doc/${PF}:" setup.py || die + distutils-r1_src_prepare +} + +python_test() { + # Do not use Makefile target as it does not setup environment correclty + esetup.py nosetests -v --where cloudinit --where tests/unittests || die +} + +python_install() { + distutils-r1_python_install --init-system=sysvinit_openrc,systemd --distro gentoo +} + +python_install_all() { + keepdir /etc/cloud + + distutils-r1_python_install_all + + # installs as non-executable + chmod +x "${D}"/etc/init.d/* +} + +pkg_postinst() { + elog "cloud-init-local needs to be run in the boot runlevel because it" + elog "modifies services in the default runlevel. When a runlevel is started" + elog "it is cached, so modifications that happen to the current runlevel" + elog "while you are in it are not acted upon." +} diff --git a/app-emulation/cloud-init/cloud-init-9999.ebuild b/app-emulation/cloud-init/cloud-init-9999.ebuild index 0b0b7bcaac95..141eb23c883a 100644 --- a/app-emulation/cloud-init/cloud-init-9999.ebuild +++ b/app-emulation/cloud-init/cloud-init-9999.ebuild @@ -47,8 +47,13 @@ RDEPEND=" " PATCHES=( + # Fix Gentoo support + # https://code.launchpad.net/~gilles-dartiguelongue/cloud-init/+git/cloud-init/+merge/358777 "${FILESDIR}"/${PN}-18.4-fix-packages-module.patch "${FILESDIR}"/${PN}-18.4-gentoo-support-upstream-templates.patch + "${FILESDIR}"/18.4-fix-filename-for-storing-locale.patch + "${FILESDIR}"/18.4-fix-update_package_sources-function.patch + "${FILESDIR}"/18.4-add-support-for-package_upgrade.patch ) python_prepare_all() { diff --git a/app-emulation/cloud-init/files/18.4-add-support-for-package_upgrade.patch b/app-emulation/cloud-init/files/18.4-add-support-for-package_upgrade.patch new file mode 100644 index 000000000000..9c542cfc0777 --- /dev/null +++ b/app-emulation/cloud-init/files/18.4-add-support-for-package_upgrade.patch @@ -0,0 +1,54 @@ +From 7868b97507d0dd7d7721ad5c4539e22c67635f92 Mon Sep 17 00:00:00 2001 +From: Gilles Dartiguelongue <eva@gentoo.org> +Date: Wed, 14 Nov 2018 15:58:30 +0100 +Subject: [PATCH 5/5] gentoo: add support for package_upgrade + +--- + cloudinit/distros/gentoo.py | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py +index 7b838e82..22ad2cf3 100644 +--- a/cloudinit/distros/gentoo.py ++++ b/cloudinit/distros/gentoo.py +@@ -189,23 +189,26 @@ class Distro(distros.Distro): + distros.set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz)) + + def package_command(self, command, args=None, pkgs=None): +- if pkgs is None: +- pkgs = [] +- + cmd = ['emerge'] + # Redirect output + cmd.append("--quiet") + +- if args and isinstance(args, str): +- cmd.append(args) +- elif args and isinstance(args, list): +- cmd.extend(args) ++ if command == "upgrade": ++ cmd.extend(["--update", "world"]) ++ else: ++ if pkgs is None: ++ pkgs = [] ++ ++ if args and isinstance(args, str): ++ cmd.append(args) ++ elif args and isinstance(args, list): ++ cmd.extend(args) + +- if command: +- cmd.append(command) ++ if command: ++ cmd.append(command) + +- pkglist = util.expand_package_list('%s-%s', pkgs) +- cmd.extend(pkglist) ++ pkglist = util.expand_package_list('%s-%s', pkgs) ++ cmd.extend(pkglist) + + # Allow the output of this to flow outwards (ie not be captured) + util.subp(cmd, capture=False) +-- +2.19.1 + diff --git a/app-emulation/cloud-init/files/18.4-fix-filename-for-storing-locale.patch b/app-emulation/cloud-init/files/18.4-fix-filename-for-storing-locale.patch new file mode 100644 index 000000000000..a5bbf6034ac5 --- /dev/null +++ b/app-emulation/cloud-init/files/18.4-fix-filename-for-storing-locale.patch @@ -0,0 +1,30 @@ +From 3756cdea3e844b9611de321a8075df80e7dbf74d Mon Sep 17 00:00:00 2001 +From: Gilles Dartiguelongue <eva@gentoo.org> +Date: Wed, 14 Nov 2018 15:28:22 +0100 +Subject: [PATCH 3/5] gentoo: fix filename for storing locale + +There must have been a misunderstanding as locale.gen is meant to +contain locales to be generated if no argument is passed to locale-gen. + +When using openrc, Gentoo stores system locale in /etc/env.d/02locale +which is generally manipulated through eselect. +--- + cloudinit/distros/gentoo.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py +index 98ac41ca..50bb61fb 100644 +--- a/cloudinit/distros/gentoo.py ++++ b/cloudinit/distros/gentoo.py +@@ -20,7 +20,7 @@ LOG = logging.getLogger(__name__) + + + class Distro(distros.Distro): +- locale_conf_fn = '/etc/locale.gen' ++ locale_conf_fn = '/etc/env.d/02locale' + network_conf_fn = '/etc/conf.d/net' + resolve_conf_fn = '/etc/resolv.conf' + hostname_conf_fn = '/etc/conf.d/hostname' +-- +2.19.1 + diff --git a/app-emulation/cloud-init/files/18.4-fix-update_package_sources-function.patch b/app-emulation/cloud-init/files/18.4-fix-update_package_sources-function.patch new file mode 100644 index 000000000000..d90258d1bc48 --- /dev/null +++ b/app-emulation/cloud-init/files/18.4-fix-update_package_sources-function.patch @@ -0,0 +1,26 @@ +From b15c4c4b24c894b3c8d444466110c881c35525e2 Mon Sep 17 00:00:00 2001 +From: Gilles Dartiguelongue <eva@gentoo.org> +Date: Wed, 14 Nov 2018 15:35:37 +0100 +Subject: [PATCH 4/5] gentoo: fix update_package_sources function + +Method is meant to update packages repository, not to update the system. +--- + cloudinit/distros/gentoo.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py +index 50bb61fb..7b838e82 100644 +--- a/cloudinit/distros/gentoo.py ++++ b/cloudinit/distros/gentoo.py +@@ -212,7 +212,7 @@ class Distro(distros.Distro): + + def update_package_sources(self): + self._runner.run("update-sources", self.package_command, +- ["-u", "world"], freq=PER_INSTANCE) ++ ["--sync"], freq=PER_INSTANCE) + + + def convert_resolv_conf(settings): +-- +2.19.1 + diff --git a/app-emulation/cloud-init/files/cloud-init-18.4-gentoo-support-upstream-templates.patch b/app-emulation/cloud-init/files/cloud-init-18.4-gentoo-support-upstream-templates.patch index 60d9da600557..6f87399af94b 100644 --- a/app-emulation/cloud-init/files/cloud-init-18.4-gentoo-support-upstream-templates.patch +++ b/app-emulation/cloud-init/files/cloud-init-18.4-gentoo-support-upstream-templates.patch @@ -1,7 +1,7 @@ -From 946ce2b005a71e9922654af79bce51fefa16c3d4 Mon Sep 17 00:00:00 2001 +From 823454f1ea140ec47f5f9c5c3c5ad62eb458eb8a Mon Sep 17 00:00:00 2001 From: Gilles Dartiguelongue <eva@gentoo.org> Date: Wed, 24 Oct 2018 10:52:46 +0200 -Subject: [PATCH 2/2] Add support for gentoo in cloud.cfg and templates +Subject: [PATCH 2/5] Add support for gentoo in cloud.cfg and templates --- config/cloud.cfg.tmpl | 8 ++++++-- @@ -11,7 +11,7 @@ Subject: [PATCH 2/2] Add support for gentoo in cloud.cfg and templates create mode 100644 templates/hosts.gentoo.tmpl diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl -index 1fef133a..f66b5f7e 100644 +index 1fef133a..3f5a41a2 100644 --- a/config/cloud.cfg.tmpl +++ b/config/cloud.cfg.tmpl @@ -134,7 +134,7 @@ cloud_final_modules: @@ -39,7 +39,7 @@ index 1fef133a..f66b5f7e 100644 +{% elif variant == "gentoo" %} + groups: [users, wheel] + primary_group: users -+ no-user-group: true ++ no_user_group: true {% else %} groups: [wheel, adm, systemd-journal] {% endif %} @@ -87,5 +87,5 @@ index 8b7cb875..d109044e 100755 if "avoid-pep8-E402-import-not-top-of-file": _tdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) -- -2.19.0 +2.19.1 |