1 |
commit: e98de08886fcfdc46109c1d38048247174a9e0ac |
2 |
Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 20 11:12:16 2018 +0000 |
4 |
Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 20 11:13:15 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e98de088 |
7 |
|
8 |
app-emulation/cloud-init: update gentoo fixes |
9 |
|
10 |
Package-Manager: Portage-2.3.51, Repoman-2.3.12 |
11 |
Signed-off-by: Gilles Dartiguelongue <eva <AT> gentoo.org> |
12 |
|
13 |
...-init-9999.ebuild => cloud-init-18.4-r1.ebuild} | 20 ++++---- |
14 |
app-emulation/cloud-init/cloud-init-9999.ebuild | 5 ++ |
15 |
.../18.4-add-support-for-package_upgrade.patch | 54 ++++++++++++++++++++++ |
16 |
.../18.4-fix-filename-for-storing-locale.patch | 30 ++++++++++++ |
17 |
.../18.4-fix-update_package_sources-function.patch | 26 +++++++++++ |
18 |
...it-18.4-gentoo-support-upstream-templates.patch | 10 ++-- |
19 |
6 files changed, 132 insertions(+), 13 deletions(-) |
20 |
|
21 |
diff --git a/app-emulation/cloud-init/cloud-init-9999.ebuild b/app-emulation/cloud-init/cloud-init-18.4-r1.ebuild |
22 |
similarity index 77% |
23 |
copy from app-emulation/cloud-init/cloud-init-9999.ebuild |
24 |
copy to app-emulation/cloud-init/cloud-init-18.4-r1.ebuild |
25 |
index 0b0b7bcaac9..34fd8b7e077 100644 |
26 |
--- a/app-emulation/cloud-init/cloud-init-9999.ebuild |
27 |
+++ b/app-emulation/cloud-init/cloud-init-18.4-r1.ebuild |
28 |
@@ -4,15 +4,15 @@ |
29 |
EAPI=6 |
30 |
PYTHON_COMPAT=( python2_7 python3_4 python3_5 python3_6 ) |
31 |
|
32 |
-inherit distutils-r1 git-r3 |
33 |
+inherit distutils-r1 |
34 |
|
35 |
DESCRIPTION="Cloud instance initialisation magic" |
36 |
HOMEPAGE="https://launchpad.net/cloud-init" |
37 |
-EGIT_REPO_URI="https://git.launchpad.net/cloud-init" |
38 |
+SRC_URI="https://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.gz" |
39 |
|
40 |
LICENSE="GPL-3" |
41 |
SLOT="0" |
42 |
-KEYWORDS="" |
43 |
+KEYWORDS="~amd64 ~x86" |
44 |
IUSE="test" |
45 |
|
46 |
CDEPEND=" |
47 |
@@ -47,15 +47,19 @@ RDEPEND=" |
48 |
" |
49 |
|
50 |
PATCHES=( |
51 |
- "${FILESDIR}"/${PN}-18.4-fix-packages-module.patch |
52 |
- "${FILESDIR}"/${PN}-18.4-gentoo-support-upstream-templates.patch |
53 |
+ # Fix Gentoo support |
54 |
+ # https://code.launchpad.net/~gilles-dartiguelongue/cloud-init/+git/cloud-init/+merge/358777 |
55 |
+ "${FILESDIR}"/${P}-fix-packages-module.patch |
56 |
+ "${FILESDIR}"/${P}-gentoo-support-upstream-templates.patch |
57 |
+ "${FILESDIR}"/${PV}-fix-filename-for-storing-locale.patch |
58 |
+ "${FILESDIR}"/${PV}-fix-update_package_sources-function.patch |
59 |
+ "${FILESDIR}"/${PV}-add-support-for-package_upgrade.patch |
60 |
) |
61 |
|
62 |
-python_prepare_all() { |
63 |
+src_prepare() { |
64 |
# Fix location of documentation installation |
65 |
sed -i "s:USR + '/share/doc/cloud-init:USR + '/share/doc/${PF}:" setup.py || die |
66 |
- sed -i 's/version=get_version(),/version=9999,/g' setup.py || die |
67 |
- distutils-r1_python_prepare_all |
68 |
+ distutils-r1_src_prepare |
69 |
} |
70 |
|
71 |
python_test() { |
72 |
|
73 |
diff --git a/app-emulation/cloud-init/cloud-init-9999.ebuild b/app-emulation/cloud-init/cloud-init-9999.ebuild |
74 |
index 0b0b7bcaac9..141eb23c883 100644 |
75 |
--- a/app-emulation/cloud-init/cloud-init-9999.ebuild |
76 |
+++ b/app-emulation/cloud-init/cloud-init-9999.ebuild |
77 |
@@ -47,8 +47,13 @@ RDEPEND=" |
78 |
" |
79 |
|
80 |
PATCHES=( |
81 |
+ # Fix Gentoo support |
82 |
+ # https://code.launchpad.net/~gilles-dartiguelongue/cloud-init/+git/cloud-init/+merge/358777 |
83 |
"${FILESDIR}"/${PN}-18.4-fix-packages-module.patch |
84 |
"${FILESDIR}"/${PN}-18.4-gentoo-support-upstream-templates.patch |
85 |
+ "${FILESDIR}"/18.4-fix-filename-for-storing-locale.patch |
86 |
+ "${FILESDIR}"/18.4-fix-update_package_sources-function.patch |
87 |
+ "${FILESDIR}"/18.4-add-support-for-package_upgrade.patch |
88 |
) |
89 |
|
90 |
python_prepare_all() { |
91 |
|
92 |
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 |
93 |
new file mode 100644 |
94 |
index 00000000000..9c542cfc077 |
95 |
--- /dev/null |
96 |
+++ b/app-emulation/cloud-init/files/18.4-add-support-for-package_upgrade.patch |
97 |
@@ -0,0 +1,54 @@ |
98 |
+From 7868b97507d0dd7d7721ad5c4539e22c67635f92 Mon Sep 17 00:00:00 2001 |
99 |
+From: Gilles Dartiguelongue <eva@g.o> |
100 |
+Date: Wed, 14 Nov 2018 15:58:30 +0100 |
101 |
+Subject: [PATCH 5/5] gentoo: add support for package_upgrade |
102 |
+ |
103 |
+--- |
104 |
+ cloudinit/distros/gentoo.py | 25 ++++++++++++++----------- |
105 |
+ 1 file changed, 14 insertions(+), 11 deletions(-) |
106 |
+ |
107 |
+diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py |
108 |
+index 7b838e82..22ad2cf3 100644 |
109 |
+--- a/cloudinit/distros/gentoo.py |
110 |
++++ b/cloudinit/distros/gentoo.py |
111 |
+@@ -189,23 +189,26 @@ class Distro(distros.Distro): |
112 |
+ distros.set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz)) |
113 |
+ |
114 |
+ def package_command(self, command, args=None, pkgs=None): |
115 |
+- if pkgs is None: |
116 |
+- pkgs = [] |
117 |
+- |
118 |
+ cmd = ['emerge'] |
119 |
+ # Redirect output |
120 |
+ cmd.append("--quiet") |
121 |
+ |
122 |
+- if args and isinstance(args, str): |
123 |
+- cmd.append(args) |
124 |
+- elif args and isinstance(args, list): |
125 |
+- cmd.extend(args) |
126 |
++ if command == "upgrade": |
127 |
++ cmd.extend(["--update", "world"]) |
128 |
++ else: |
129 |
++ if pkgs is None: |
130 |
++ pkgs = [] |
131 |
++ |
132 |
++ if args and isinstance(args, str): |
133 |
++ cmd.append(args) |
134 |
++ elif args and isinstance(args, list): |
135 |
++ cmd.extend(args) |
136 |
+ |
137 |
+- if command: |
138 |
+- cmd.append(command) |
139 |
++ if command: |
140 |
++ cmd.append(command) |
141 |
+ |
142 |
+- pkglist = util.expand_package_list('%s-%s', pkgs) |
143 |
+- cmd.extend(pkglist) |
144 |
++ pkglist = util.expand_package_list('%s-%s', pkgs) |
145 |
++ cmd.extend(pkglist) |
146 |
+ |
147 |
+ # Allow the output of this to flow outwards (ie not be captured) |
148 |
+ util.subp(cmd, capture=False) |
149 |
+-- |
150 |
+2.19.1 |
151 |
+ |
152 |
|
153 |
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 |
154 |
new file mode 100644 |
155 |
index 00000000000..a5bbf6034ac |
156 |
--- /dev/null |
157 |
+++ b/app-emulation/cloud-init/files/18.4-fix-filename-for-storing-locale.patch |
158 |
@@ -0,0 +1,30 @@ |
159 |
+From 3756cdea3e844b9611de321a8075df80e7dbf74d Mon Sep 17 00:00:00 2001 |
160 |
+From: Gilles Dartiguelongue <eva@g.o> |
161 |
+Date: Wed, 14 Nov 2018 15:28:22 +0100 |
162 |
+Subject: [PATCH 3/5] gentoo: fix filename for storing locale |
163 |
+ |
164 |
+There must have been a misunderstanding as locale.gen is meant to |
165 |
+contain locales to be generated if no argument is passed to locale-gen. |
166 |
+ |
167 |
+When using openrc, Gentoo stores system locale in /etc/env.d/02locale |
168 |
+which is generally manipulated through eselect. |
169 |
+--- |
170 |
+ cloudinit/distros/gentoo.py | 2 +- |
171 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
172 |
+ |
173 |
+diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py |
174 |
+index 98ac41ca..50bb61fb 100644 |
175 |
+--- a/cloudinit/distros/gentoo.py |
176 |
++++ b/cloudinit/distros/gentoo.py |
177 |
+@@ -20,7 +20,7 @@ LOG = logging.getLogger(__name__) |
178 |
+ |
179 |
+ |
180 |
+ class Distro(distros.Distro): |
181 |
+- locale_conf_fn = '/etc/locale.gen' |
182 |
++ locale_conf_fn = '/etc/env.d/02locale' |
183 |
+ network_conf_fn = '/etc/conf.d/net' |
184 |
+ resolve_conf_fn = '/etc/resolv.conf' |
185 |
+ hostname_conf_fn = '/etc/conf.d/hostname' |
186 |
+-- |
187 |
+2.19.1 |
188 |
+ |
189 |
|
190 |
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 |
191 |
new file mode 100644 |
192 |
index 00000000000..d90258d1bc4 |
193 |
--- /dev/null |
194 |
+++ b/app-emulation/cloud-init/files/18.4-fix-update_package_sources-function.patch |
195 |
@@ -0,0 +1,26 @@ |
196 |
+From b15c4c4b24c894b3c8d444466110c881c35525e2 Mon Sep 17 00:00:00 2001 |
197 |
+From: Gilles Dartiguelongue <eva@g.o> |
198 |
+Date: Wed, 14 Nov 2018 15:35:37 +0100 |
199 |
+Subject: [PATCH 4/5] gentoo: fix update_package_sources function |
200 |
+ |
201 |
+Method is meant to update packages repository, not to update the system. |
202 |
+--- |
203 |
+ cloudinit/distros/gentoo.py | 2 +- |
204 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
205 |
+ |
206 |
+diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py |
207 |
+index 50bb61fb..7b838e82 100644 |
208 |
+--- a/cloudinit/distros/gentoo.py |
209 |
++++ b/cloudinit/distros/gentoo.py |
210 |
+@@ -212,7 +212,7 @@ class Distro(distros.Distro): |
211 |
+ |
212 |
+ def update_package_sources(self): |
213 |
+ self._runner.run("update-sources", self.package_command, |
214 |
+- ["-u", "world"], freq=PER_INSTANCE) |
215 |
++ ["--sync"], freq=PER_INSTANCE) |
216 |
+ |
217 |
+ |
218 |
+ def convert_resolv_conf(settings): |
219 |
+-- |
220 |
+2.19.1 |
221 |
+ |
222 |
|
223 |
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 |
224 |
index 60d9da60055..6f87399af94 100644 |
225 |
--- a/app-emulation/cloud-init/files/cloud-init-18.4-gentoo-support-upstream-templates.patch |
226 |
+++ b/app-emulation/cloud-init/files/cloud-init-18.4-gentoo-support-upstream-templates.patch |
227 |
@@ -1,7 +1,7 @@ |
228 |
-From 946ce2b005a71e9922654af79bce51fefa16c3d4 Mon Sep 17 00:00:00 2001 |
229 |
+From 823454f1ea140ec47f5f9c5c3c5ad62eb458eb8a Mon Sep 17 00:00:00 2001 |
230 |
From: Gilles Dartiguelongue <eva@g.o> |
231 |
Date: Wed, 24 Oct 2018 10:52:46 +0200 |
232 |
-Subject: [PATCH 2/2] Add support for gentoo in cloud.cfg and templates |
233 |
+Subject: [PATCH 2/5] Add support for gentoo in cloud.cfg and templates |
234 |
|
235 |
--- |
236 |
config/cloud.cfg.tmpl | 8 ++++++-- |
237 |
@@ -11,7 +11,7 @@ Subject: [PATCH 2/2] Add support for gentoo in cloud.cfg and templates |
238 |
create mode 100644 templates/hosts.gentoo.tmpl |
239 |
|
240 |
diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl |
241 |
-index 1fef133a..f66b5f7e 100644 |
242 |
+index 1fef133a..3f5a41a2 100644 |
243 |
--- a/config/cloud.cfg.tmpl |
244 |
+++ b/config/cloud.cfg.tmpl |
245 |
@@ -134,7 +134,7 @@ cloud_final_modules: |
246 |
@@ -39,7 +39,7 @@ index 1fef133a..f66b5f7e 100644 |
247 |
+{% elif variant == "gentoo" %} |
248 |
+ groups: [users, wheel] |
249 |
+ primary_group: users |
250 |
-+ no-user-group: true |
251 |
++ no_user_group: true |
252 |
{% else %} |
253 |
groups: [wheel, adm, systemd-journal] |
254 |
{% endif %} |
255 |
@@ -87,5 +87,5 @@ index 8b7cb875..d109044e 100755 |
256 |
if "avoid-pep8-E402-import-not-top-of-file": |
257 |
_tdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) |
258 |
-- |
259 |
-2.19.0 |
260 |
+2.19.1 |