diff options
author | Mike Gilbert <floppym@gentoo.org> | 2017-06-02 16:16:11 -0400 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2017-06-02 16:17:49 -0400 |
commit | 85e669f604e31250cfbacd6b358c5e248382d784 (patch) | |
tree | fba689b716eb9c74ba7991e0d5607736f9b30499 /sys-apps/systemd | |
parent | www-client/chromium: dev channel bump (60.0.3112.10) (diff) | |
download | gentoo-85e669f604e31250cfbacd6b358c5e248382d784.tar.gz gentoo-85e669f604e31250cfbacd6b358c5e248382d784.tar.bz2 gentoo-85e669f604e31250cfbacd6b358c5e248382d784.zip |
sys-apps/systemd: rework symlinks for merged usr systems
Use absolute paths to avoid breaking symlinks across /usr.
Remove symlinks in pkg_preinst if they would cause a collision.
Package-Manager: Portage-2.3.6_p1, Repoman-2.3.2_p69
Diffstat (limited to 'sys-apps/systemd')
-rw-r--r-- | sys-apps/systemd/systemd-9999.ebuild | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sys-apps/systemd/systemd-9999.ebuild b/sys-apps/systemd/systemd-9999.ebuild index beab35a74419..098d5affbf17 100644 --- a/sys-apps/systemd/systemd-9999.ebuild +++ b/sys-apps/systemd/systemd-9999.ebuild @@ -301,9 +301,9 @@ multilib_src_install_all() { if use sysv-utils; then for app in halt poweroff reboot runlevel shutdown telinit; do - dosym "..${ROOTPREFIX%/}/bin/systemctl" /sbin/${app} + dosym "${EPREFIX}${ROOTPREFIX%/}/bin/systemctl" /sbin/${app} done - dosym "..${ROOTPREFIX%/}/lib/systemd/systemd" /sbin/init + dosym "${EPREFIX}${ROOTPREFIX%/}/lib/systemd/systemd" /sbin/init else # we just keep sysvinit tools, so no need for the mans rm "${ED%/}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \ @@ -331,8 +331,8 @@ multilib_src_install_all() { if [[ ! -e "${ED%/}"/usr/lib/systemd/systemd ]]; then # Avoid breaking boot/reboot - dosym "../../..${ROOTPREFIX%/}/lib/systemd/systemd" /usr/lib/systemd/systemd - dosym "../../..${ROOTPREFIX%/}/lib/systemd/systemd-shutdown" /usr/lib/systemd/systemd-shutdown + dosym "${EPREFIX}${ROOTPREFIX%/}/lib/systemd/systemd" /usr/lib/systemd/systemd + dosym "${EPREFIX}${ROOTPREFIX%/}/lib/systemd/systemd-shutdown" /usr/lib/systemd/systemd-shutdown fi } @@ -380,6 +380,19 @@ migrate_locale() { fi } +pkg_preinst() { + # If /lib/systemd and /usr/lib/systemd are the same directory, remove the + # symlinks we created in src_install. + if [[ $(realpath "${EROOT%/}${ROOTPREFIX}/lib/systemd") == $(realpath "${EROOT%/}/usr/lib/systemd") ]]; then + if [[ -L ${ED%/}/usr/lib/systemd/systemd ]]; then + rm "${ED%/}/usr/lib/systemd/systemd" || die + fi + if [[ -L ${ED%/}/usr/lib/systemd/systemd-shutdown ]]; then + rm "${ED%/}/usr/lib/systemd/systemd-shutdown" || die + fi + fi +} + pkg_postinst() { newusergroup() { enewgroup "$1" |