summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bettler <thomas.bettler@gmail.com>2022-04-08 00:13:10 +0200
committerMatthew Thode <prometheanfire@gentoo.org>2022-04-08 14:03:43 -0500
commitf4c814c4c7ee3b4d9740fecb99394208213fb3d5 (patch)
treeb59aeb768cbc3e8f46f637e01f39be3145d83ce4 /app-emulation
parentwww-client/otter: add 1.0.03 (diff)
downloadgentoo-f4c814c4c7ee3b4d9740fecb99394208213fb3d5.tar.gz
gentoo-f4c814c4c7ee3b4d9740fecb99394208213fb3d5.tar.bz2
gentoo-f4c814c4c7ee3b4d9740fecb99394208213fb3d5.zip
app-emulation/cloud-init: bump to 22.1
Closes: https://github.com/gentoo/gentoo/pull/24949 Signed-off-by: Thomas Bettler <thomas.bettler@gmail.com> Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
Diffstat (limited to 'app-emulation')
-rw-r--r--app-emulation/cloud-init/Manifest1
-rw-r--r--app-emulation/cloud-init/cloud-init-22.1.ebuild89
-rw-r--r--app-emulation/cloud-init/cloud-init-9999.ebuild23
-rw-r--r--app-emulation/cloud-init/files/22.1-add-support-for-package_upgrade.patch48
-rw-r--r--app-emulation/cloud-init/files/22.1-fix-update_package_sources-function.patch21
5 files changed, 168 insertions, 14 deletions
diff --git a/app-emulation/cloud-init/Manifest b/app-emulation/cloud-init/Manifest
index 52f471a1757f..2daed96816fa 100644
--- a/app-emulation/cloud-init/Manifest
+++ b/app-emulation/cloud-init/Manifest
@@ -1,2 +1,3 @@
DIST cloud-init-20.4.tar.gz 1228898 BLAKE2B c5697af31e7219a060a82732fbae2e89dd00786e5b0feb638f1f64f6ce861df041ef687a6095cc3bdb5478f4f4c1504286155808102aea9cae853caa97d4ba1b SHA512 da2fa4673b253468380c4472795fd449809c8ac84d8f13ec1472b9b7e7d54e187ae06e5a81a36774793b05f4e1212dca57bc19aa8955b4c7fa7183cb100bfbb9
DIST cloud-init-21.2.tar.gz 1278878 BLAKE2B 74e07649a24fc85df54aafcd72797a05f0bdbcceb90fe90c6af7024da09e876780b67bb1d7963cd164d03e3151715944b1f3fd5709d3557ac341a09061409fcc SHA512 8cc24945efc6f16b3c64411c5e7e5b83582d337f1c3f546163d52c14a6177ff752e91ba1fec04b7ade800f921c2b79c04d032df62c2b4171930ca1fb74c49a7d
+DIST cloud-init-22.1.tar.gz 1313034 BLAKE2B ca55378db822cdf58808de1bd2b519861c50ad8b08ed699212827833e0134fdc0968b76a4c2a13f39eae1d20ef8b22a99ff99b85ef77e496fd41593f4e2f2d55 SHA512 485e358777379a22dd2b0f6aa7afb1751eb44831c6e03ecbbd9c6823eaa20535e6e83fc245818ce1bb207425976839b356dadcfa3cfe62385b9d340b08ff21ab
diff --git a/app-emulation/cloud-init/cloud-init-22.1.ebuild b/app-emulation/cloud-init/cloud-init-22.1.ebuild
new file mode 100644
index 000000000000..ace04bcfa721
--- /dev/null
+++ b/app-emulation/cloud-init/cloud-init-22.1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit distutils-r1
+
+if [[ ${PV} == *9999 ]];then
+ inherit git-r3
+ EGIT_REPO_URI="https://git.launchpad.net/cloud-init"
+else
+ SRC_URI="https://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64 ~x86"
+fi
+
+DESCRIPTION="Cloud instance initialisation magic"
+HOMEPAGE="https://launchpad.net/cloud-init"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="test"
+RESTRICT="!test? ( 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="
+ ${CDEPEND}
+ test? (
+ >=dev-python/httpretty-0.7.1[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ dev-python/nose[${PYTHON_USEDEP}]
+ dev-python/coverage[${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}"/22.1-fix-update_package_sources-function.patch
+ "${FILESDIR}"/22.1-add-support-for-package_upgrade.patch
+)
+
+distutils_enable_tests nose
+
+python_prepare_all() {
+ # Fix location of documentation installation
+ sed -i "s:USR + '/share/doc/cloud-init:USR + '/share/doc/${PF}:" setup.py || die
+ sed -i 's/version=get_version(),/version=9999,/g' setup.py || die
+ distutils-r1_python_prepare_all
+}
+
+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 c355c9f901de..ace04bcfa721 100644
--- a/app-emulation/cloud-init/cloud-init-9999.ebuild
+++ b/app-emulation/cloud-init/cloud-init-9999.ebuild
@@ -1,9 +1,10 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
-PYTHON_COMPAT=( python3_7 python3_8 python3_9 )
-DISTUTILS_USE_SETUPTOOLS=rdepend
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} )
inherit distutils-r1
@@ -35,8 +36,8 @@ CDEPEND="
dev-python/six[${PYTHON_USEDEP}]
"
DEPEND="
- test? (
${CDEPEND}
+ test? (
>=dev-python/httpretty-0.7.1[${PYTHON_USEDEP}]
dev-python/mock[${PYTHON_USEDEP}]
dev-python/nose[${PYTHON_USEDEP}]
@@ -54,13 +55,12 @@ 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}-21.2-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
+ "${FILESDIR}"/22.1-fix-update_package_sources-function.patch
+ "${FILESDIR}"/22.1-add-support-for-package_upgrade.patch
)
+distutils_enable_tests nose
+
python_prepare_all() {
# Fix location of documentation installation
sed -i "s:USR + '/share/doc/cloud-init:USR + '/share/doc/${PF}:" setup.py || die
@@ -68,11 +68,6 @@ python_prepare_all() {
distutils-r1_python_prepare_all
}
-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
}
diff --git a/app-emulation/cloud-init/files/22.1-add-support-for-package_upgrade.patch b/app-emulation/cloud-init/files/22.1-add-support-for-package_upgrade.patch
new file mode 100644
index 000000000000..124b4225d830
--- /dev/null
+++ b/app-emulation/cloud-init/files/22.1-add-support-for-package_upgrade.patch
@@ -0,0 +1,48 @@
+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
+
+---
+diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py
+index 4eb76da8..702cda8a 100644
+--- a/cloudinit/distros/gentoo.py
++++ b/cloudinit/distros/gentoo.py
+@@ -218,23 +218,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 = list("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)
+ subp.subp(cmd, capture=False)
diff --git a/app-emulation/cloud-init/files/22.1-fix-update_package_sources-function.patch b/app-emulation/cloud-init/files/22.1-fix-update_package_sources-function.patch
new file mode 100644
index 000000000000..7a1b938e4e60
--- /dev/null
+++ b/app-emulation/cloud-init/files/22.1-fix-update_package_sources-function.patch
@@ -0,0 +1,21 @@
+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.
+---
+
+diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py
+index 702cda8a..37217fe4 100644
+--- a/cloudinit/distros/gentoo.py
++++ b/cloudinit/distros/gentoo.py
+@@ -246,7 +246,7 @@ class Distro(distros.Distro):
+ self._runner.run(
+ "update-sources",
+ self.package_command,
+- ["-u", "world"],
++ ["--sync"],
+ freq=PER_INSTANCE,
+ )
+