1 |
commit: 85e669f604e31250cfbacd6b358c5e248382d784 |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 2 20:16:11 2017 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 2 20:17:49 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85e669f6 |
7 |
|
8 |
sys-apps/systemd: rework symlinks for merged usr systems |
9 |
|
10 |
Use absolute paths to avoid breaking symlinks across /usr. |
11 |
Remove symlinks in pkg_preinst if they would cause a collision. |
12 |
|
13 |
Package-Manager: Portage-2.3.6_p1, Repoman-2.3.2_p69 |
14 |
|
15 |
sys-apps/systemd/systemd-9999.ebuild | 21 +++++++++++++++++---- |
16 |
1 file changed, 17 insertions(+), 4 deletions(-) |
17 |
|
18 |
diff --git a/sys-apps/systemd/systemd-9999.ebuild b/sys-apps/systemd/systemd-9999.ebuild |
19 |
index beab35a7441..098d5affbf1 100644 |
20 |
--- a/sys-apps/systemd/systemd-9999.ebuild |
21 |
+++ b/sys-apps/systemd/systemd-9999.ebuild |
22 |
@@ -301,9 +301,9 @@ multilib_src_install_all() { |
23 |
|
24 |
if use sysv-utils; then |
25 |
for app in halt poweroff reboot runlevel shutdown telinit; do |
26 |
- dosym "..${ROOTPREFIX%/}/bin/systemctl" /sbin/${app} |
27 |
+ dosym "${EPREFIX}${ROOTPREFIX%/}/bin/systemctl" /sbin/${app} |
28 |
done |
29 |
- dosym "..${ROOTPREFIX%/}/lib/systemd/systemd" /sbin/init |
30 |
+ dosym "${EPREFIX}${ROOTPREFIX%/}/lib/systemd/systemd" /sbin/init |
31 |
else |
32 |
# we just keep sysvinit tools, so no need for the mans |
33 |
rm "${ED%/}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \ |
34 |
@@ -331,8 +331,8 @@ multilib_src_install_all() { |
35 |
|
36 |
if [[ ! -e "${ED%/}"/usr/lib/systemd/systemd ]]; then |
37 |
# Avoid breaking boot/reboot |
38 |
- dosym "../../..${ROOTPREFIX%/}/lib/systemd/systemd" /usr/lib/systemd/systemd |
39 |
- dosym "../../..${ROOTPREFIX%/}/lib/systemd/systemd-shutdown" /usr/lib/systemd/systemd-shutdown |
40 |
+ dosym "${EPREFIX}${ROOTPREFIX%/}/lib/systemd/systemd" /usr/lib/systemd/systemd |
41 |
+ dosym "${EPREFIX}${ROOTPREFIX%/}/lib/systemd/systemd-shutdown" /usr/lib/systemd/systemd-shutdown |
42 |
fi |
43 |
} |
44 |
|
45 |
@@ -380,6 +380,19 @@ migrate_locale() { |
46 |
fi |
47 |
} |
48 |
|
49 |
+pkg_preinst() { |
50 |
+ # If /lib/systemd and /usr/lib/systemd are the same directory, remove the |
51 |
+ # symlinks we created in src_install. |
52 |
+ if [[ $(realpath "${EROOT%/}${ROOTPREFIX}/lib/systemd") == $(realpath "${EROOT%/}/usr/lib/systemd") ]]; then |
53 |
+ if [[ -L ${ED%/}/usr/lib/systemd/systemd ]]; then |
54 |
+ rm "${ED%/}/usr/lib/systemd/systemd" || die |
55 |
+ fi |
56 |
+ if [[ -L ${ED%/}/usr/lib/systemd/systemd-shutdown ]]; then |
57 |
+ rm "${ED%/}/usr/lib/systemd/systemd-shutdown" || die |
58 |
+ fi |
59 |
+ fi |
60 |
+} |
61 |
+ |
62 |
pkg_postinst() { |
63 |
newusergroup() { |
64 |
enewgroup "$1" |