pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/emulators/compat_netbsd



Module Name:    pkgsrc
Committed By:   he
Date:           Sun Jan  2 16:15:55 UTC 2022

Modified Files:
        pkgsrc/emulators/compat_netbsd: INSTALL.ELF

Log Message:
Don't just remove a symlink on removal, ensure that it points
to an expected name before doing so.  Should prevent removal of
required symlinks which might otherwise happen when this package
by accident is instsalled and subsequently de-installed on
9.0 - 9.2 or other netbsd-9 variants.
Parts of fix for PR#56597.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 pkgsrc/emulators/compat_netbsd/INSTALL.ELF

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/emulators/compat_netbsd/INSTALL.ELF
diff -u pkgsrc/emulators/compat_netbsd/INSTALL.ELF:1.2 pkgsrc/emulators/compat_netbsd/INSTALL.ELF:1.3
--- pkgsrc/emulators/compat_netbsd/INSTALL.ELF:1.2      Sun Feb 17 10:34:31 2013
+++ pkgsrc/emulators/compat_netbsd/INSTALL.ELF  Sun Jan  2 16:15:55 2022
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL.ELF,v 1.2 2013/02/17 10:34:31 spz Exp $
+# $NetBSD: INSTALL.ELF,v 1.3 2022/01/02 16:15:55 he Exp $
 
 # Generate a +ROOT_ACTIONS script that runs certain actions that require
 # superuser privileges.
@@ -83,8 +83,15 @@ REMOVE,0)
                esac
 
                if ${TEST} -h "$dst"; then
-                       ${ECHO} "${PKGNAME}: removing $dst"
-                       ${RM} -f "$dst"
+                       lsrc=$(readlink $dst)
+                       if [ "$lsrc" = ${PKG_PREFIX}/$src -o \
+                            "$lsrc" = $src ]
+                       then
+                               ${ECHO} "${PKGNAME}: removing $dst"
+                               ${RM} -f "$dst"
+                       else
+                               ${ECHO} "${PKGNAME}: mismatched symlink, skipping removal of $dst"
+                       fi
                fi
        done
        ${RM} -f ${ROOT_ACTIONS_COOKIE}



Home | Main Index | Thread Index | Old Index