commit:     10eacc40e4a8224746508b40d16f9e3eb2526555
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  7 21:39:42 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Dec  7 21:39:42 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10eacc40

sys-apps/systemd: simplify pkg_preinst check

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-apps/systemd/systemd-251.7.ebuild | 9 ++++-----
 sys-apps/systemd/systemd-251.8.ebuild | 9 ++++-----
 sys-apps/systemd/systemd-252.2.ebuild | 9 ++++-----
 sys-apps/systemd/systemd-9999.ebuild  | 9 ++++-----
 4 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/sys-apps/systemd/systemd-251.7.ebuild 
b/sys-apps/systemd/systemd-251.7.ebuild
index 57967cf1b395..84c6c3db0074 100644
--- a/sys-apps/systemd/systemd-251.7.ebuild
+++ b/sys-apps/systemd/systemd-251.7.ebuild
@@ -471,16 +471,15 @@ migrate_locale() {
 pkg_preinst() {
        if ! use split-usr; then
                local dir
-               for dir in bin sbin lib; do
-                       if [[ ! ${EROOT}/${dir} -ef ${EROOT}/usr/${dir} ]]; then
-                               eerror "\"${EROOT}/${dir}\" and 
\"${EROOT}/usr/${dir}\" are not merged."
-                               eerror "One of them should be a symbolic link 
to the other one."
+               for dir in bin sbin lib usr/sbin; do
+                       if [[ ! -L ${EROOT}/${dir} ]]; then
+                               eerror "'${EROOT}/${dir}' is not a symbolic 
link."
                                FAIL=1
                        fi
                done
                if [[ ${FAIL} ]]; then
                        eerror "Migration to system layout with merged 
directories must be performed before"
-                       eerror "rebuilding ${CATEGORY}/${PN} with 
USE=\"-split-usr\" to avoid run-time breakage."
+                       eerror "installing ${CATEGORY}/${PN} with 
USE=\"-split-usr\" to avoid run-time breakage."
                        die "System layout with split directories still used"
                fi
        fi

diff --git a/sys-apps/systemd/systemd-251.8.ebuild 
b/sys-apps/systemd/systemd-251.8.ebuild
index 66941daa38cf..f529ba8b84df 100644
--- a/sys-apps/systemd/systemd-251.8.ebuild
+++ b/sys-apps/systemd/systemd-251.8.ebuild
@@ -466,16 +466,15 @@ migrate_locale() {
 pkg_preinst() {
        if ! use split-usr; then
                local dir
-               for dir in bin sbin lib; do
-                       if [[ ! ${EROOT}/${dir} -ef ${EROOT}/usr/${dir} ]]; then
-                               eerror "\"${EROOT}/${dir}\" and 
\"${EROOT}/usr/${dir}\" are not merged."
-                               eerror "One of them should be a symbolic link 
to the other one."
+               for dir in bin sbin lib usr/sbin; do
+                       if [[ ! -L ${EROOT}/${dir} ]]; then
+                               eerror "'${EROOT}/${dir}' is not a symbolic 
link."
                                FAIL=1
                        fi
                done
                if [[ ${FAIL} ]]; then
                        eerror "Migration to system layout with merged 
directories must be performed before"
-                       eerror "rebuilding ${CATEGORY}/${PN} with 
USE=\"-split-usr\" to avoid run-time breakage."
+                       eerror "installing ${CATEGORY}/${PN} with 
USE=\"-split-usr\" to avoid run-time breakage."
                        die "System layout with split directories still used"
                fi
        fi

diff --git a/sys-apps/systemd/systemd-252.2.ebuild 
b/sys-apps/systemd/systemd-252.2.ebuild
index 03c6870db441..6a423f8c5593 100644
--- a/sys-apps/systemd/systemd-252.2.ebuild
+++ b/sys-apps/systemd/systemd-252.2.ebuild
@@ -465,16 +465,15 @@ migrate_locale() {
 pkg_preinst() {
        if ! use split-usr; then
                local dir
-               for dir in bin sbin lib; do
-                       if [[ ! ${EROOT}/${dir} -ef ${EROOT}/usr/${dir} ]]; then
-                               eerror "\"${EROOT}/${dir}\" and 
\"${EROOT}/usr/${dir}\" are not merged."
-                               eerror "One of them should be a symbolic link 
to the other one."
+               for dir in bin sbin lib usr/sbin; do
+                       if [[ ! -L ${EROOT}/${dir} ]]; then
+                               eerror "'${EROOT}/${dir}' is not a symbolic 
link."
                                FAIL=1
                        fi
                done
                if [[ ${FAIL} ]]; then
                        eerror "Migration to system layout with merged 
directories must be performed before"
-                       eerror "rebuilding ${CATEGORY}/${PN} with 
USE=\"-split-usr\" to avoid run-time breakage."
+                       eerror "installing ${CATEGORY}/${PN} with 
USE=\"-split-usr\" to avoid run-time breakage."
                        die "System layout with split directories still used"
                fi
        fi

diff --git a/sys-apps/systemd/systemd-9999.ebuild 
b/sys-apps/systemd/systemd-9999.ebuild
index 03c6870db441..6a423f8c5593 100644
--- a/sys-apps/systemd/systemd-9999.ebuild
+++ b/sys-apps/systemd/systemd-9999.ebuild
@@ -465,16 +465,15 @@ migrate_locale() {
 pkg_preinst() {
        if ! use split-usr; then
                local dir
-               for dir in bin sbin lib; do
-                       if [[ ! ${EROOT}/${dir} -ef ${EROOT}/usr/${dir} ]]; then
-                               eerror "\"${EROOT}/${dir}\" and 
\"${EROOT}/usr/${dir}\" are not merged."
-                               eerror "One of them should be a symbolic link 
to the other one."
+               for dir in bin sbin lib usr/sbin; do
+                       if [[ ! -L ${EROOT}/${dir} ]]; then
+                               eerror "'${EROOT}/${dir}' is not a symbolic 
link."
                                FAIL=1
                        fi
                done
                if [[ ${FAIL} ]]; then
                        eerror "Migration to system layout with merged 
directories must be performed before"
-                       eerror "rebuilding ${CATEGORY}/${PN} with 
USE=\"-split-usr\" to avoid run-time breakage."
+                       eerror "installing ${CATEGORY}/${PN} with 
USE=\"-split-usr\" to avoid run-time breakage."
                        die "System layout with split directories still used"
                fi
        fi

Reply via email to