1 |
commit: 30fe8b89aef9f0701f6dcd935421b8ed5da614cc |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 23 18:37:56 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 1 14:52:45 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30fe8b89 |
7 |
|
8 |
sys-libs/glibc: replace systemd reexec with a warning |
9 |
|
10 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
11 |
Closes: https://github.com/gentoo/gentoo/pull/22960 |
12 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
13 |
|
14 |
sys-libs/glibc/glibc-2.34-r2.ebuild | 21 ++++++++++++++++----- |
15 |
sys-libs/glibc/glibc-9999.ebuild | 21 ++++++++++++++++----- |
16 |
2 files changed, 32 insertions(+), 10 deletions(-) |
17 |
|
18 |
diff --git a/sys-libs/glibc/glibc-2.34-r2.ebuild b/sys-libs/glibc/glibc-2.34-r2.ebuild |
19 |
index 04479ab604b7..dd50e8578a35 100644 |
20 |
--- a/sys-libs/glibc/glibc-2.34-r2.ebuild |
21 |
+++ b/sys-libs/glibc/glibc-2.34-r2.ebuild |
22 |
@@ -730,6 +730,20 @@ sanity_prechecks() { |
23 |
fi |
24 |
} |
25 |
|
26 |
+upgrade_warning() { |
27 |
+ if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then |
28 |
+ local oldv newv=$(ver_cut 1-2 ${PV}) |
29 |
+ for oldv in ${REPLACING_VERSIONS}; do |
30 |
+ if ver_test ${oldv} -lt ${newv}; then |
31 |
+ ewarn "After upgrading glibc, please restart all running processes." |
32 |
+ ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)." |
33 |
+ ewarn "Alternatively, reboot your system." |
34 |
+ break |
35 |
+ fi |
36 |
+ done |
37 |
+ fi |
38 |
+} |
39 |
+ |
40 |
# |
41 |
# the phases |
42 |
# |
43 |
@@ -740,6 +754,7 @@ pkg_pretend() { |
44 |
# All the checks... |
45 |
einfo "Checking general environment sanity." |
46 |
sanity_prechecks |
47 |
+ upgrade_warning |
48 |
} |
49 |
|
50 |
pkg_setup() { |
51 |
@@ -1547,11 +1562,7 @@ pkg_postinst() { |
52 |
use compile-locales || run_locale_gen "${EROOT}/" |
53 |
fi |
54 |
|
55 |
- if systemd_is_booted && [[ -z ${ROOT} ]] ; then |
56 |
- # We need to restart systemd when upgrading from < 2.34 |
57 |
- # bug #823756 |
58 |
- systemctl daemon-reexec |
59 |
- fi |
60 |
+ upgrade_warning |
61 |
|
62 |
# Check for sanity of /etc/nsswitch.conf, take 2 |
63 |
if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then |
64 |
|
65 |
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild |
66 |
index 72cca561f703..79318fb53543 100644 |
67 |
--- a/sys-libs/glibc/glibc-9999.ebuild |
68 |
+++ b/sys-libs/glibc/glibc-9999.ebuild |
69 |
@@ -723,6 +723,20 @@ sanity_prechecks() { |
70 |
fi |
71 |
} |
72 |
|
73 |
+upgrade_warning() { |
74 |
+ if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then |
75 |
+ local oldv newv=$(ver_cut 1-2 ${PV}) |
76 |
+ for oldv in ${REPLACING_VERSIONS}; do |
77 |
+ if ver_test ${oldv} -lt ${newv}; then |
78 |
+ ewarn "After upgrading glibc, please restart all running processes." |
79 |
+ ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)." |
80 |
+ ewarn "Alternatively, reboot your system." |
81 |
+ break |
82 |
+ fi |
83 |
+ done |
84 |
+ fi |
85 |
+} |
86 |
+ |
87 |
# |
88 |
# the phases |
89 |
# |
90 |
@@ -733,6 +747,7 @@ pkg_pretend() { |
91 |
# All the checks... |
92 |
einfo "Checking general environment sanity." |
93 |
sanity_prechecks |
94 |
+ upgrade_warning |
95 |
} |
96 |
|
97 |
pkg_setup() { |
98 |
@@ -1540,11 +1555,7 @@ pkg_postinst() { |
99 |
use compile-locales || run_locale_gen "${EROOT}/" |
100 |
fi |
101 |
|
102 |
- if systemd_is_booted && [[ -z ${ROOT} ]] ; then |
103 |
- # We need to restart systemd when upgrading from < 2.34 |
104 |
- # bug #823756 |
105 |
- systemctl daemon-reexec |
106 |
- fi |
107 |
+ upgrade_warning |
108 |
|
109 |
# Check for sanity of /etc/nsswitch.conf, take 2 |
110 |
if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then |