commit:     f10efb4adc6e0266f0c0b1995c0ff01aa8e9cf28
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  5 17:34:01 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov  6 02:35:11 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f10efb4a

sys-libs/glibc: preserve libcrypt.so.1 as an orphan

This should help users who have FEATURES="-preserve-libs protect-owned".

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
Bug: https://bugs.gentoo.org/809410
Closes: https://github.com/gentoo/gentoo/pull/22833
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/glibc/glibc-2.33-r7.ebuild | 5 +++--
 sys-libs/glibc/glibc-2.34.ebuild    | 5 +++--
 sys-libs/glibc/glibc-9999.ebuild    | 5 +++--
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/sys-libs/glibc/glibc-2.33-r7.ebuild 
b/sys-libs/glibc/glibc-2.33-r7.ebuild
index 1f78af9e694..cb9826d7be2 100644
--- a/sys-libs/glibc/glibc-2.33-r7.ebuild
+++ b/sys-libs/glibc/glibc-2.33-r7.ebuild
@@ -1503,9 +1503,9 @@ pkg_preinst() {
        # Keep around libcrypt so that Perl doesn't break when merging libxcrypt
        # (libxcrypt is the new provider for now of libcrypt.so.{1,2}).
        # bug #802207
-       if ! use crypt && has_version "${CATEGORY}/${PN}[crypt]"; then
+       if ! use crypt && has_version "${CATEGORY}/${PN}[crypt]" && ! has 
preserve-libs ${FEATURES}; then
                PRESERVED_OLD_LIBCRYPT=1
-               preserve_old_lib /$(get_libdir)/libcrypt$(get_libname 1)
+               cp -p "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" 
"${T}/libcrypt$(get_libname 1)" || die
        else
                PRESERVED_OLD_LIBCRYPT=0
        fi
@@ -1540,6 +1540,7 @@ pkg_postinst() {
        fi
 
        if [[ ${PRESERVED_OLD_LIBCRYPT} -eq 1 ]] ; then
+               cp -p "${T}/libcrypt$(get_libname 1)" 
"${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" || die
                preserve_old_lib_notify /$(get_libdir)/libcrypt$(get_libname 1)
 
                elog "Please ignore a possible later error message about a file 
collision involving"

diff --git a/sys-libs/glibc/glibc-2.34.ebuild b/sys-libs/glibc/glibc-2.34.ebuild
index e98c13cc390..a553af44216 100644
--- a/sys-libs/glibc/glibc-2.34.ebuild
+++ b/sys-libs/glibc/glibc-2.34.ebuild
@@ -1516,9 +1516,9 @@ pkg_preinst() {
        # Keep around libcrypt so that Perl doesn't break when merging libxcrypt
        # (libxcrypt is the new provider for now of libcrypt.so.{1,2}).
        # bug #802207
-       if ! use crypt && has_version "${CATEGORY}/${PN}[crypt]"; then
+       if ! use crypt && has_version "${CATEGORY}/${PN}[crypt]" && ! has 
preserve-libs ${FEATURES}; then
                PRESERVED_OLD_LIBCRYPT=1
-               preserve_old_lib /$(get_libdir)/libcrypt$(get_libname 1)
+               cp -p "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" 
"${T}/libcrypt$(get_libname 1)" || die
        else
                PRESERVED_OLD_LIBCRYPT=0
        fi
@@ -1553,6 +1553,7 @@ pkg_postinst() {
        fi
 
        if [[ ${PRESERVED_OLD_LIBCRYPT} -eq 1 ]] ; then
+               cp -p "${T}/libcrypt$(get_libname 1)" 
"${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" || die
                preserve_old_lib_notify /$(get_libdir)/libcrypt$(get_libname 1)
 
                elog "Please ignore a possible later error message about a file 
collision involving"

diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index c1752e4d398..b08e07445f5 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -1516,9 +1516,9 @@ pkg_preinst() {
        # Keep around libcrypt so that Perl doesn't break when merging libxcrypt
        # (libxcrypt is the new provider for now of libcrypt.so.{1,2}).
        # bug #802207
-       if ! use crypt && has_version "${CATEGORY}/${PN}[crypt]"; then
+       if ! use crypt && has_version "${CATEGORY}/${PN}[crypt]" && ! has 
preserve-libs ${FEATURES}; then
                PRESERVED_OLD_LIBCRYPT=1
-               preserve_old_lib /$(get_libdir)/libcrypt$(get_libname 1)
+               cp -p "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" 
"${T}/libcrypt$(get_libname 1)" || die
        else
                PRESERVED_OLD_LIBCRYPT=0
        fi
@@ -1553,6 +1553,7 @@ pkg_postinst() {
        fi
 
        if [[ ${PRESERVED_OLD_LIBCRYPT} -eq 1 ]] ; then
+               cp -p "${T}/libcrypt$(get_libname 1)" 
"${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" || die
                preserve_old_lib_notify /$(get_libdir)/libcrypt$(get_libname 1)
 
                elog "Please ignore a possible later error message about a file 
collision involving"

Reply via email to