commit:     c00da1b0765547584e2b7013d483d40ecb145493
Author:     Krzesimir Nowak <knowak <AT> microsoft <DOT> com>
AuthorDate: Tue Feb 20 16:06:46 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 21 02:27:34 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c00da1b0

sys-libs/libselinux: use ROOT variable in pkg_postinst

Signed-off-by: Krzesimir Nowak <knowak <AT> microsoft.com>
Closes: https://github.com/gentoo/gentoo/pull/35441
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../{libselinux-3.6.ebuild => libselinux-3.6-r1.ebuild}           | 8 ++++----
 sys-libs/libselinux/libselinux-9999.ebuild                        | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/sys-libs/libselinux/libselinux-3.6.ebuild 
b/sys-libs/libselinux/libselinux-3.6-r1.ebuild
similarity index 92%
rename from sys-libs/libselinux/libselinux-3.6.ebuild
rename to sys-libs/libselinux/libselinux-3.6-r1.ebuild
index 11ce9f3236ba..8ff2227a55c4 100644
--- a/sys-libs/libselinux/libselinux-3.6.ebuild
+++ b/sys-libs/libselinux/libselinux-3.6-r1.ebuild
@@ -145,12 +145,12 @@ pkg_postinst() {
        # Fix bug 473502
        for POLTYPE in ${POLICY_TYPES};
        do
-               mkdir -p /etc/selinux/${POLTYPE}/contexts/files || die
-               touch 
/etc/selinux/${POLTYPE}/contexts/files/file_contexts.local || die
+               mkdir -p "${ROOT}/etc/selinux/${POLTYPE}/contexts/files" || die
+               touch 
"${ROOT}/etc/selinux/${POLTYPE}/contexts/files/file_contexts.local" || die
                # Fix bug 516608
                for EXPRFILE in file_contexts file_contexts.homedirs 
file_contexts.local ; do
-                       if [[ -f 
"/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE}" ]]; then
-                               sefcontext_compile 
/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE} \
+                       if [[ -f 
"${ROOT}/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE}" ]]; then
+                               sefcontext_compile 
"${ROOT}/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE}" \
                                || die "Failed to recompile contexts"
                        fi
                done

diff --git a/sys-libs/libselinux/libselinux-9999.ebuild 
b/sys-libs/libselinux/libselinux-9999.ebuild
index 941b189dd857..5b1c48a22c08 100644
--- a/sys-libs/libselinux/libselinux-9999.ebuild
+++ b/sys-libs/libselinux/libselinux-9999.ebuild
@@ -145,12 +145,12 @@ pkg_postinst() {
        # Fix bug 473502
        for POLTYPE in ${POLICY_TYPES};
        do
-               mkdir -p /etc/selinux/${POLTYPE}/contexts/files || die
-               touch 
/etc/selinux/${POLTYPE}/contexts/files/file_contexts.local || die
+               mkdir -p "${ROOT}/etc/selinux/${POLTYPE}/contexts/files" || die
+               touch 
"${ROOT}/etc/selinux/${POLTYPE}/contexts/files/file_contexts.local" || die
                # Fix bug 516608
                for EXPRFILE in file_contexts file_contexts.homedirs 
file_contexts.local ; do
-                       if [[ -f 
"/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE}" ]]; then
-                               sefcontext_compile 
/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE} \
+                       if [[ -f 
"${ROOT}/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE}" ]]; then
+                               sefcontext_compile 
"${ROOT}/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE}" \
                                || die "Failed to recompile contexts"
                        fi
                done

Reply via email to