1 |
commit: 739172f697490fcb8eff44e3d94ff94b867cfaa2 |
2 |
Author: Ian Stakenvicius <axs <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jul 25 16:15:27 2016 +0000 |
4 |
Commit: Ian Stakenvicius <axs <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jul 25 16:21:27 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=739172f6 |
7 |
|
8 |
sys-fs/eudev: ensure REPLACING_VERSIONS is processed as a list |
9 |
|
10 |
REPLACING_VERSIONS is used in eudev ebuilds during pkg_postinst to determine |
11 |
when udevadm control --reload should be called: |
12 |
- when it is a new installation of udev |
13 |
- when it is a re-emerge of the same version (or a revision-only upgrade) |
14 |
|
15 |
REPLACING_VERSIONS *should* only ever have zero or one values, but it is |
16 |
theoretically possible for it to have more than that if, for instance, a previous |
17 |
upgrade failed to complete during qmerge. If this is the case, and only one of |
18 |
the multiple versions match the version of the ebuild, then we also abort as we |
19 |
don't know which one is the "good" one. |
20 |
|
21 |
Also removed duplicate code that reloads the hwdb (looks like it was a copy-paste |
22 |
from sys-fs/udev) |
23 |
|
24 |
Bug: http://bugs.gentoo.org/589530 |
25 |
|
26 |
Package-Manager: portage-2.2.28 |
27 |
|
28 |
sys-fs/eudev/eudev-1.10-r2.ebuild | 51 ++++++++++++++++++++------------------- |
29 |
sys-fs/eudev/eudev-1.9-r2.ebuild | 51 ++++++++++++++++++++------------------- |
30 |
sys-fs/eudev/eudev-3.1.2.ebuild | 51 ++++++++++++++++++++------------------- |
31 |
sys-fs/eudev/eudev-3.1.5.ebuild | 51 ++++++++++++++++++++------------------- |
32 |
sys-fs/eudev/eudev-3.2.ebuild | 51 ++++++++++++++++++++------------------- |
33 |
sys-fs/eudev/eudev-4.9999.ebuild | 51 ++++++++++++++++++++------------------- |
34 |
sys-fs/eudev/eudev-9999.ebuild | 51 ++++++++++++++++++++------------------- |
35 |
7 files changed, 182 insertions(+), 175 deletions(-) |
36 |
|
37 |
diff --git a/sys-fs/eudev/eudev-1.10-r2.ebuild b/sys-fs/eudev/eudev-1.10-r2.ebuild |
38 |
index 83d33b8..122087f 100644 |
39 |
--- a/sys-fs/eudev/eudev-1.10-r2.ebuild |
40 |
+++ b/sys-fs/eudev/eudev-1.10-r2.ebuild |
41 |
@@ -248,22 +248,41 @@ pkg_postinst() { |
42 |
ewarn "else losetup may be confused when looking for unused devices." |
43 |
fi |
44 |
|
45 |
+ # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
46 |
+ # https://bugs.gentoo.org/246847 |
47 |
+ # https://bugs.gentoo.org/514174 |
48 |
+ enewgroup input |
49 |
+ |
50 |
+ # REPLACING_VERSIONS should only ever have zero or 1 values but in case it doesn't, |
51 |
+ # process it as a list. We only care about the zero case (new install) or the case where |
52 |
+ # the same version is being re-emerged. If there is a second version, allow it to abort. |
53 |
+ local rv rvres=doitnew |
54 |
+ for rv in ${REPLACING_VERSIONS} ; do |
55 |
+ if [[ ${rvres} == doit* ]]; then |
56 |
+ if [[ ${rv%-r*} == ${PV} ]]; then |
57 |
+ rvres=doit |
58 |
+ else |
59 |
+ rvres=${rv} |
60 |
+ fi |
61 |
+ fi |
62 |
+ done |
63 |
+ |
64 |
if use hwdb && has_version 'sys-apps/hwids[udev]'; then |
65 |
udevadm hwdb --update --root="${ROOT%/}" |
66 |
|
67 |
# https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
68 |
# reload database after it has be rebuilt, but only if we are not upgrading |
69 |
# also pass if we are -9999 since who knows what hwdb related changes there might be |
70 |
- if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \ |
71 |
- [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
72 |
+ if [[ ${rvres} == doit* ]] && [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
73 |
udevadm control --reload |
74 |
fi |
75 |
fi |
76 |
- |
77 |
- ewarn |
78 |
- ewarn "You need to restart eudev as soon as possible to make the" |
79 |
- ewarn "upgrade go into effect:" |
80 |
- ewarn "\t/etc/init.d/udev --nodeps restart" |
81 |
+ if [[ ${rvres} != doitnew ]]; then |
82 |
+ ewarn |
83 |
+ ewarn "You need to restart eudev as soon as possible to make the" |
84 |
+ ewarn "upgrade go into effect:" |
85 |
+ ewarn "\t/etc/init.d/udev --nodeps restart" |
86 |
+ fi |
87 |
|
88 |
if use rule-generator && use openrc && \ |
89 |
[[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qsv 'boot\|default\|sysinit'; then |
90 |
@@ -279,22 +298,4 @@ pkg_postinst() { |
91 |
elog "fixing known issues visit:" |
92 |
elog " https://www.gentoo.org/doc/en/udev-guide.xml" |
93 |
elog |
94 |
- |
95 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
96 |
- # https://bugs.gentoo.org/246847 |
97 |
- # https://bugs.gentoo.org/514174 |
98 |
- enewgroup input |
99 |
- |
100 |
- # Update hwdb database in case the format is changed by udev version. |
101 |
- if has_version 'sys-apps/hwids[udev]'; then |
102 |
- udevadm hwdb --update --root="${ROOT%/}" |
103 |
- # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd |
104 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
105 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
106 |
- if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then |
107 |
- return 0 |
108 |
- fi |
109 |
- udevadm control --reload |
110 |
- fi |
111 |
- fi |
112 |
} |
113 |
|
114 |
diff --git a/sys-fs/eudev/eudev-1.9-r2.ebuild b/sys-fs/eudev/eudev-1.9-r2.ebuild |
115 |
index 23f027b..1f77052 100644 |
116 |
--- a/sys-fs/eudev/eudev-1.9-r2.ebuild |
117 |
+++ b/sys-fs/eudev/eudev-1.9-r2.ebuild |
118 |
@@ -250,22 +250,41 @@ pkg_postinst() { |
119 |
ewarn "else losetup may be confused when looking for unused devices." |
120 |
fi |
121 |
|
122 |
+ # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
123 |
+ # https://bugs.gentoo.org/246847 |
124 |
+ # https://bugs.gentoo.org/514174 |
125 |
+ enewgroup input |
126 |
+ |
127 |
+ # REPLACING_VERSIONS should only ever have zero or 1 values but in case it doesn't, |
128 |
+ # process it as a list. We only care about the zero case (new install) or the case where |
129 |
+ # the same version is being re-emerged. If there is a second version, allow it to abort. |
130 |
+ local rv rvres=doitnew |
131 |
+ for rv in ${REPLACING_VERSIONS} ; do |
132 |
+ if [[ ${rvres} == doit* ]]; then |
133 |
+ if [[ ${rv%-r*} == ${PV} ]]; then |
134 |
+ rvres=doit |
135 |
+ else |
136 |
+ rvres=${rv} |
137 |
+ fi |
138 |
+ fi |
139 |
+ done |
140 |
+ |
141 |
if use hwdb && has_version 'sys-apps/hwids[udev]'; then |
142 |
udevadm hwdb --update --root="${ROOT%/}" |
143 |
|
144 |
# https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
145 |
# reload database after it has be rebuilt, but only if we are not upgrading |
146 |
# also pass if we are -9999 since who knows what hwdb related changes there might be |
147 |
- if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \ |
148 |
- [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
149 |
+ if [[ ${rvres} == doit* ]] && [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
150 |
udevadm control --reload |
151 |
fi |
152 |
fi |
153 |
- |
154 |
- ewarn |
155 |
- ewarn "You need to restart eudev as soon as possible to make the" |
156 |
- ewarn "upgrade go into effect:" |
157 |
- ewarn "\t/etc/init.d/udev --nodeps restart" |
158 |
+ if [[ ${rvres} != doitnew ]]; then |
159 |
+ ewarn |
160 |
+ ewarn "You need to restart eudev as soon as possible to make the" |
161 |
+ ewarn "upgrade go into effect:" |
162 |
+ ewarn "\t/etc/init.d/udev --nodeps restart" |
163 |
+ fi |
164 |
|
165 |
if use rule-generator && use openrc && \ |
166 |
[[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qsv 'boot\|default\|sysinit'; then |
167 |
@@ -281,22 +300,4 @@ pkg_postinst() { |
168 |
elog "fixing known issues visit:" |
169 |
elog " https://www.gentoo.org/doc/en/udev-guide.xml" |
170 |
elog |
171 |
- |
172 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
173 |
- # https://bugs.gentoo.org/246847 |
174 |
- # https://bugs.gentoo.org/514174 |
175 |
- enewgroup input |
176 |
- |
177 |
- # Update hwdb database in case the format is changed by udev version. |
178 |
- if has_version 'sys-apps/hwids[udev]'; then |
179 |
- udevadm hwdb --update --root="${ROOT%/}" |
180 |
- # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd |
181 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
182 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
183 |
- if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then |
184 |
- return 0 |
185 |
- fi |
186 |
- udevadm control --reload |
187 |
- fi |
188 |
- fi |
189 |
} |
190 |
|
191 |
diff --git a/sys-fs/eudev/eudev-3.1.2.ebuild b/sys-fs/eudev/eudev-3.1.2.ebuild |
192 |
index e061076..f17bcba 100644 |
193 |
--- a/sys-fs/eudev/eudev-3.1.2.ebuild |
194 |
+++ b/sys-fs/eudev/eudev-3.1.2.ebuild |
195 |
@@ -230,44 +230,45 @@ pkg_postinst() { |
196 |
ewarn "else losetup may be confused when looking for unused devices." |
197 |
fi |
198 |
|
199 |
+ # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
200 |
+ # https://bugs.gentoo.org/246847 |
201 |
+ # https://bugs.gentoo.org/514174 |
202 |
+ enewgroup input |
203 |
+ |
204 |
+ # REPLACING_VERSIONS should only ever have zero or 1 values but in case it doesn't, |
205 |
+ # process it as a list. We only care about the zero case (new install) or the case where |
206 |
+ # the same version is being re-emerged. If there is a second version, allow it to abort. |
207 |
+ local rv rvres=doitnew |
208 |
+ for rv in ${REPLACING_VERSIONS} ; do |
209 |
+ if [[ ${rvres} == doit* ]]; then |
210 |
+ if [[ ${rv%-r*} == ${PV} ]]; then |
211 |
+ rvres=doit |
212 |
+ else |
213 |
+ rvres=${rv} |
214 |
+ fi |
215 |
+ fi |
216 |
+ done |
217 |
+ |
218 |
if use hwdb && has_version 'sys-apps/hwids[udev]'; then |
219 |
udevadm hwdb --update --root="${ROOT%/}" |
220 |
|
221 |
# https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
222 |
# reload database after it has be rebuilt, but only if we are not upgrading |
223 |
# also pass if we are -9999 since who knows what hwdb related changes there might be |
224 |
- if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \ |
225 |
- [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
226 |
+ if [[ ${rvres} == doit* ]] && [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
227 |
udevadm control --reload |
228 |
fi |
229 |
fi |
230 |
- |
231 |
- ewarn |
232 |
- ewarn "You need to restart eudev as soon as possible to make the" |
233 |
- ewarn "upgrade go into effect:" |
234 |
- ewarn "\t/etc/init.d/udev --nodeps restart" |
235 |
+ if [[ ${rvres} != doitnew ]]; then |
236 |
+ ewarn |
237 |
+ ewarn "You need to restart eudev as soon as possible to make the" |
238 |
+ ewarn "upgrade go into effect:" |
239 |
+ ewarn "\t/etc/init.d/udev --nodeps restart" |
240 |
+ fi |
241 |
|
242 |
elog |
243 |
elog "For more information on eudev on Gentoo, writing udev rules, and" |
244 |
elog "fixing known issues visit:" |
245 |
elog " https://www.gentoo.org/doc/en/udev-guide.xml" |
246 |
elog |
247 |
- |
248 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
249 |
- # https://bugs.gentoo.org/246847 |
250 |
- # https://bugs.gentoo.org/514174 |
251 |
- enewgroup input |
252 |
- |
253 |
- # Update hwdb database in case the format is changed by udev version. |
254 |
- if has_version 'sys-apps/hwids[udev]'; then |
255 |
- udevadm hwdb --update --root="${ROOT%/}" |
256 |
- # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd |
257 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
258 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
259 |
- if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then |
260 |
- return 0 |
261 |
- fi |
262 |
- udevadm control --reload |
263 |
- fi |
264 |
- fi |
265 |
} |
266 |
|
267 |
diff --git a/sys-fs/eudev/eudev-3.1.5.ebuild b/sys-fs/eudev/eudev-3.1.5.ebuild |
268 |
index 0cb7025..a36ee54 100644 |
269 |
--- a/sys-fs/eudev/eudev-3.1.5.ebuild |
270 |
+++ b/sys-fs/eudev/eudev-3.1.5.ebuild |
271 |
@@ -190,22 +190,41 @@ pkg_postinst() { |
272 |
ewarn "else losetup may be confused when looking for unused devices." |
273 |
fi |
274 |
|
275 |
+ # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
276 |
+ # https://bugs.gentoo.org/246847 |
277 |
+ # https://bugs.gentoo.org/514174 |
278 |
+ enewgroup input |
279 |
+ |
280 |
+ # REPLACING_VERSIONS should only ever have zero or 1 values but in case it doesn't, |
281 |
+ # process it as a list. We only care about the zero case (new install) or the case where |
282 |
+ # the same version is being re-emerged. If there is a second version, allow it to abort. |
283 |
+ local rv rvres=doitnew |
284 |
+ for rv in ${REPLACING_VERSIONS} ; do |
285 |
+ if [[ ${rvres} == doit* ]]; then |
286 |
+ if [[ ${rv%-r*} == ${PV} ]]; then |
287 |
+ rvres=doit |
288 |
+ else |
289 |
+ rvres=${rv} |
290 |
+ fi |
291 |
+ fi |
292 |
+ done |
293 |
+ |
294 |
if use hwdb && has_version 'sys-apps/hwids[udev]'; then |
295 |
udevadm hwdb --update --root="${ROOT%/}" |
296 |
|
297 |
# https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
298 |
# reload database after it has be rebuilt, but only if we are not upgrading |
299 |
# also pass if we are -9999 since who knows what hwdb related changes there might be |
300 |
- if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \ |
301 |
- [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
302 |
+ if [[ ${rvres} == doit* ]] && [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
303 |
udevadm control --reload |
304 |
fi |
305 |
fi |
306 |
- |
307 |
- ewarn |
308 |
- ewarn "You need to restart eudev as soon as possible to make the" |
309 |
- ewarn "upgrade go into effect:" |
310 |
- ewarn "\t/etc/init.d/udev --nodeps restart" |
311 |
+ if [[ ${rvres} != doitnew ]]; then |
312 |
+ ewarn |
313 |
+ ewarn "You need to restart eudev as soon as possible to make the" |
314 |
+ ewarn "upgrade go into effect:" |
315 |
+ ewarn "\t/etc/init.d/udev --nodeps restart" |
316 |
+ fi |
317 |
|
318 |
if use rule-generator && \ |
319 |
[[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qsv 'boot\|default\|sysinit'; then |
320 |
@@ -221,22 +240,4 @@ pkg_postinst() { |
321 |
elog "fixing known issues visit:" |
322 |
elog " https://www.gentoo.org/doc/en/udev-guide.xml" |
323 |
elog |
324 |
- |
325 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
326 |
- # https://bugs.gentoo.org/246847 |
327 |
- # https://bugs.gentoo.org/514174 |
328 |
- enewgroup input |
329 |
- |
330 |
- # Update hwdb database in case the format is changed by udev version. |
331 |
- if has_version 'sys-apps/hwids[udev]'; then |
332 |
- udevadm hwdb --update --root="${ROOT%/}" |
333 |
- # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd |
334 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
335 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
336 |
- if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then |
337 |
- return 0 |
338 |
- fi |
339 |
- udevadm control --reload |
340 |
- fi |
341 |
- fi |
342 |
} |
343 |
|
344 |
diff --git a/sys-fs/eudev/eudev-3.2.ebuild b/sys-fs/eudev/eudev-3.2.ebuild |
345 |
index 52c351c..e70d954 100644 |
346 |
--- a/sys-fs/eudev/eudev-3.2.ebuild |
347 |
+++ b/sys-fs/eudev/eudev-3.2.ebuild |
348 |
@@ -190,22 +190,41 @@ pkg_postinst() { |
349 |
ewarn "else losetup may be confused when looking for unused devices." |
350 |
fi |
351 |
|
352 |
+ # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
353 |
+ # https://bugs.gentoo.org/246847 |
354 |
+ # https://bugs.gentoo.org/514174 |
355 |
+ enewgroup input |
356 |
+ |
357 |
+ # REPLACING_VERSIONS should only ever have zero or 1 values but in case it doesn't, |
358 |
+ # process it as a list. We only care about the zero case (new install) or the case where |
359 |
+ # the same version is being re-emerged. If there is a second version, allow it to abort. |
360 |
+ local rv rvres=doitnew |
361 |
+ for rv in ${REPLACING_VERSIONS} ; do |
362 |
+ if [[ ${rvres} == doit* ]]; then |
363 |
+ if [[ ${rv%-r*} == ${PV} ]]; then |
364 |
+ rvres=doit |
365 |
+ else |
366 |
+ rvres=${rv} |
367 |
+ fi |
368 |
+ fi |
369 |
+ done |
370 |
+ |
371 |
if use hwdb && has_version 'sys-apps/hwids[udev]'; then |
372 |
udevadm hwdb --update --root="${ROOT%/}" |
373 |
|
374 |
# https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
375 |
# reload database after it has be rebuilt, but only if we are not upgrading |
376 |
# also pass if we are -9999 since who knows what hwdb related changes there might be |
377 |
- if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \ |
378 |
- [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
379 |
+ if [[ ${rvres} == doit* ]] && [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
380 |
udevadm control --reload |
381 |
fi |
382 |
fi |
383 |
- |
384 |
- ewarn |
385 |
- ewarn "You need to restart eudev as soon as possible to make the" |
386 |
- ewarn "upgrade go into effect:" |
387 |
- ewarn "\t/etc/init.d/udev --nodeps restart" |
388 |
+ if [[ ${rvres} != doitnew ]]; then |
389 |
+ ewarn |
390 |
+ ewarn "You need to restart eudev as soon as possible to make the" |
391 |
+ ewarn "upgrade go into effect:" |
392 |
+ ewarn "\t/etc/init.d/udev --nodeps restart" |
393 |
+ fi |
394 |
|
395 |
if use rule-generator && \ |
396 |
[[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qsv 'boot\|default\|sysinit'; then |
397 |
@@ -221,22 +240,4 @@ pkg_postinst() { |
398 |
elog "fixing known issues visit:" |
399 |
elog " https://www.gentoo.org/doc/en/udev-guide.xml" |
400 |
elog |
401 |
- |
402 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
403 |
- # https://bugs.gentoo.org/246847 |
404 |
- # https://bugs.gentoo.org/514174 |
405 |
- enewgroup input |
406 |
- |
407 |
- # Update hwdb database in case the format is changed by udev version. |
408 |
- if has_version 'sys-apps/hwids[udev]'; then |
409 |
- udevadm hwdb --update --root="${ROOT%/}" |
410 |
- # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd |
411 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
412 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
413 |
- if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then |
414 |
- return 0 |
415 |
- fi |
416 |
- udevadm control --reload |
417 |
- fi |
418 |
- fi |
419 |
} |
420 |
|
421 |
diff --git a/sys-fs/eudev/eudev-4.9999.ebuild b/sys-fs/eudev/eudev-4.9999.ebuild |
422 |
index 57d3d76..2d29640 100644 |
423 |
--- a/sys-fs/eudev/eudev-4.9999.ebuild |
424 |
+++ b/sys-fs/eudev/eudev-4.9999.ebuild |
425 |
@@ -184,44 +184,45 @@ pkg_postinst() { |
426 |
ewarn "else losetup may be confused when looking for unused devices." |
427 |
fi |
428 |
|
429 |
+ # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
430 |
+ # https://bugs.gentoo.org/246847 |
431 |
+ # https://bugs.gentoo.org/514174 |
432 |
+ enewgroup input |
433 |
+ |
434 |
+ # REPLACING_VERSIONS should only ever have zero or 1 values but in case it doesn't, |
435 |
+ # process it as a list. We only care about the zero case (new install) or the case where |
436 |
+ # the same version is being re-emerged. If there is a second version, allow it to abort. |
437 |
+ local rv rvres=doitnew |
438 |
+ for rv in ${REPLACING_VERSIONS} ; do |
439 |
+ if [[ ${rvres} == doit* ]]; then |
440 |
+ if [[ ${rv%-r*} == ${PV} ]]; then |
441 |
+ rvres=doit |
442 |
+ else |
443 |
+ rvres=${rv} |
444 |
+ fi |
445 |
+ fi |
446 |
+ done |
447 |
+ |
448 |
if use hwdb && has_version 'sys-apps/hwids[udev]'; then |
449 |
udevadm hwdb --update --root="${ROOT%/}" |
450 |
|
451 |
# https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
452 |
# reload database after it has be rebuilt, but only if we are not upgrading |
453 |
# also pass if we are -9999 since who knows what hwdb related changes there might be |
454 |
- if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \ |
455 |
- [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
456 |
+ if [[ ${rvres} == doit* ]] && [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
457 |
udevadm control --reload |
458 |
fi |
459 |
fi |
460 |
- |
461 |
- ewarn |
462 |
- ewarn "You need to restart eudev as soon as possible to make the" |
463 |
- ewarn "upgrade go into effect:" |
464 |
- ewarn "\t/etc/init.d/udev --nodeps restart" |
465 |
+ if [[ ${rvres} != doitnew ]]; then |
466 |
+ ewarn |
467 |
+ ewarn "You need to restart eudev as soon as possible to make the" |
468 |
+ ewarn "upgrade go into effect:" |
469 |
+ ewarn "\t/etc/init.d/udev --nodeps restart" |
470 |
+ fi |
471 |
|
472 |
elog |
473 |
elog "For more information on eudev on Gentoo, writing udev rules, and" |
474 |
elog "fixing known issues visit:" |
475 |
elog " https://www.gentoo.org/doc/en/udev-guide.xml" |
476 |
elog |
477 |
- |
478 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
479 |
- # https://bugs.gentoo.org/246847 |
480 |
- # https://bugs.gentoo.org/514174 |
481 |
- enewgroup input |
482 |
- |
483 |
- # Update hwdb database in case the format is changed by udev version. |
484 |
- if has_version 'sys-apps/hwids[udev]'; then |
485 |
- udevadm hwdb --update --root="${ROOT%/}" |
486 |
- # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd |
487 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
488 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
489 |
- if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then |
490 |
- return 0 |
491 |
- fi |
492 |
- udevadm control --reload |
493 |
- fi |
494 |
- fi |
495 |
} |
496 |
|
497 |
diff --git a/sys-fs/eudev/eudev-9999.ebuild b/sys-fs/eudev/eudev-9999.ebuild |
498 |
index 52c351c..e70d954 100644 |
499 |
--- a/sys-fs/eudev/eudev-9999.ebuild |
500 |
+++ b/sys-fs/eudev/eudev-9999.ebuild |
501 |
@@ -190,22 +190,41 @@ pkg_postinst() { |
502 |
ewarn "else losetup may be confused when looking for unused devices." |
503 |
fi |
504 |
|
505 |
+ # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
506 |
+ # https://bugs.gentoo.org/246847 |
507 |
+ # https://bugs.gentoo.org/514174 |
508 |
+ enewgroup input |
509 |
+ |
510 |
+ # REPLACING_VERSIONS should only ever have zero or 1 values but in case it doesn't, |
511 |
+ # process it as a list. We only care about the zero case (new install) or the case where |
512 |
+ # the same version is being re-emerged. If there is a second version, allow it to abort. |
513 |
+ local rv rvres=doitnew |
514 |
+ for rv in ${REPLACING_VERSIONS} ; do |
515 |
+ if [[ ${rvres} == doit* ]]; then |
516 |
+ if [[ ${rv%-r*} == ${PV} ]]; then |
517 |
+ rvres=doit |
518 |
+ else |
519 |
+ rvres=${rv} |
520 |
+ fi |
521 |
+ fi |
522 |
+ done |
523 |
+ |
524 |
if use hwdb && has_version 'sys-apps/hwids[udev]'; then |
525 |
udevadm hwdb --update --root="${ROOT%/}" |
526 |
|
527 |
# https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
528 |
# reload database after it has be rebuilt, but only if we are not upgrading |
529 |
# also pass if we are -9999 since who knows what hwdb related changes there might be |
530 |
- if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \ |
531 |
- [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
532 |
+ if [[ ${rvres} == doit* ]] && [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then |
533 |
udevadm control --reload |
534 |
fi |
535 |
fi |
536 |
- |
537 |
- ewarn |
538 |
- ewarn "You need to restart eudev as soon as possible to make the" |
539 |
- ewarn "upgrade go into effect:" |
540 |
- ewarn "\t/etc/init.d/udev --nodeps restart" |
541 |
+ if [[ ${rvres} != doitnew ]]; then |
542 |
+ ewarn |
543 |
+ ewarn "You need to restart eudev as soon as possible to make the" |
544 |
+ ewarn "upgrade go into effect:" |
545 |
+ ewarn "\t/etc/init.d/udev --nodeps restart" |
546 |
+ fi |
547 |
|
548 |
if use rule-generator && \ |
549 |
[[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qsv 'boot\|default\|sysinit'; then |
550 |
@@ -221,22 +240,4 @@ pkg_postinst() { |
551 |
elog "fixing known issues visit:" |
552 |
elog " https://www.gentoo.org/doc/en/udev-guide.xml" |
553 |
elog |
554 |
- |
555 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69 |
556 |
- # https://bugs.gentoo.org/246847 |
557 |
- # https://bugs.gentoo.org/514174 |
558 |
- enewgroup input |
559 |
- |
560 |
- # Update hwdb database in case the format is changed by udev version. |
561 |
- if has_version 'sys-apps/hwids[udev]'; then |
562 |
- udevadm hwdb --update --root="${ROOT%/}" |
563 |
- # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd |
564 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
565 |
- # https://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda |
566 |
- if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then |
567 |
- return 0 |
568 |
- fi |
569 |
- udevadm control --reload |
570 |
- fi |
571 |
- fi |
572 |
} |