summaryrefslogtreecommitdiff
path: root/source/a/pkgtools/scripts/removepkg
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2020-04-02 06:07:52 +0000
committerEric Hameleers <alien@slackware.com>2020-04-02 10:41:33 +0200
commit7bd3e8d27d710021f848ba0b9e9772443c65e597 (patch)
treef4d816f8faa399edbf48c0325630473d069a354f /source/a/pkgtools/scripts/removepkg
parent99c7cafd7376277cb010e2b7de0bf40de7ee6282 (diff)
downloadcurrent-7bd3e8d27d710021f848ba0b9e9772443c65e597.tar.gz
Thu Apr 2 06:07:52 UTC 202020200402060752
a/hwdata-0.334-noarch-1.txz: Upgraded. a/kernel-generic-5.4.29-x86_64-1.txz: Upgraded. a/kernel-huge-5.4.29-x86_64-1.txz: Upgraded. a/kernel-modules-5.4.29-x86_64-1.txz: Upgraded. a/pkgtools-15.0-noarch-32.txz: Rebuilt. installpkg: handle the uninstall script packaged as /install/douninst.sh. removepkg: add --skip-douninst option to skip running the uninstall script. Save removed douninst.sh in /var/log/pkgtools/removed_uninstall_scripts. ap/groff-1.22.4-x86_64-2.txz: Rebuilt. Fixed docdir. Thanks to Xsane. d/gcc-9.3.0-x86_64-2.txz: Rebuilt. d/gcc-brig-9.3.0-x86_64-2.txz: Rebuilt. d/gcc-g++-9.3.0-x86_64-2.txz: Rebuilt. d/gcc-gdc-9.3.0-x86_64-2.txz: Rebuilt. d/gcc-gfortran-9.3.0-x86_64-2.txz: Rebuilt. Patched a compiler bug concerning assumed-shape vs. deferred-shape arrays. Thanks to Lockywolf. d/gcc-gnat-9.3.0-x86_64-2.txz: Rebuilt. d/gcc-go-9.3.0-x86_64-2.txz: Rebuilt. d/gcc-objc-9.3.0-x86_64-2.txz: Rebuilt. d/kernel-headers-5.4.29-x86-1.txz: Upgraded. d/ruby-2.7.1-x86_64-1.txz: Upgraded. This update fixes security issues: Unsafe Object Creation Vulnerability in JSON (Additional fix). Heap exposure vulnerability in the socket library. For more information, see: https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663/ https://www.ruby-lang.org/en/news/2020/03/31/heap-exposure-in-socket-cve-2020-10933/ https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10663 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10933 (* Security fix *) k/kernel-source-5.4.29-noarch-1.txz: Upgraded. l/graphite2-1.3.14-x86_64-1.txz: Upgraded. l/librsvg-2.48.2-x86_64-1.txz: Upgraded. l/utf8proc-2.5.0-x86_64-1.txz: Upgraded. x/libva-2.7.0-x86_64-1.txz: Upgraded. x/libva-utils-2.7.1-x86_64-1.txz: Upgraded. isolinux/initrd.img: Rebuilt. kernels/*: Upgraded. usb-and-pxe-installers/usbboot.img: Rebuilt.
Diffstat (limited to 'source/a/pkgtools/scripts/removepkg')
-rw-r--r--source/a/pkgtools/scripts/removepkg22
1 files changed, 15 insertions, 7 deletions
diff --git a/source/a/pkgtools/scripts/removepkg b/source/a/pkgtools/scripts/removepkg
index 0166a59b..5a1c7dcd 100644
--- a/source/a/pkgtools/scripts/removepkg
+++ b/source/a/pkgtools/scripts/removepkg
@@ -24,6 +24,10 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Wed Apr 1 22:14:46 UTC 2020
+# Add --skip-douninst option to skip running the uninstall script.
+# Save removed uninstall scripts in /var/log/removed_uninstall_scripts.
+#
# Tue Mar 31 03:06:25 UTC 2020
# Support an uninstall script to be executed when the package is removed.
# The script should be a standard sh script with the same name as the package
@@ -252,7 +256,9 @@ delete_files() {
preserve_file "$FILE"
fi
else
- ! [ $TERSE ] && echo " --> $ROOT/$FILE no longer exists. Skipping."
+ if [ "$(echo $FILE | cut -b1-8)" != "install/" ]; then
+ ! [ $TERSE ] && echo " --> $ROOT/$FILE no longer exists. Skipping."
+ fi
fi
else
preserve_dir "$FILE"
@@ -337,9 +343,9 @@ remove_packages() {
if [ ! "$WARN" = true ]; then
echo "Removing package: $(basename $ADM_DIR/packages/$PKGNAME)"
# If there's an uninstall script, save it:
- if [ -r $ADM_DIR/douninst.sh/$PKGNAME ]; then
+ if [ -r $ADM_DIR/douninst.sh/$PKGNAME -a ! "$SKIP_DOUNINST" = "true" ]; then
cp -a $ADM_DIR/douninst.sh/$PKGNAME $TMP/$PKGNAME
- elif [ -r $ADM_DIR/douninst.sh/$(echo ${PKGNAME} | sed "s/-upgraded.*//") ]; then
+ elif [ -r $ADM_DIR/douninst.sh/$(echo ${PKGNAME} | sed "s/-upgraded.*//") -a ! "$SKIP_DOUNINST" = "true" ]; then
cp -a $ADM_DIR/douninst.sh/$(echo ${PKGNAME} | sed "s/-upgraded.*//") $TMP/$PKGNAME
else
rm -f $TMP/$PKGNAME
@@ -391,8 +397,8 @@ remove_packages() {
if [ ! "$WARN" = "true" ]; then
# We won't assume that anything in /var/log can be trusted to remain there,
# so we'll remake the directories and symlinks first:
- mkdir -p $LOG_DIR/removed_packages $LOG_DIR/removed_scripts
- for symlink in removed_packages removed_scripts ; do
+ mkdir -p $LOG_DIR/removed_packages $LOG_DIR/removed_scripts $LOG_DIR/removed_uninstall_scripts
+ for symlink in removed_packages removed_scripts removed_uninstall_scripts ; do
if [ ! -L $LOG_DIR/../$symlink ]; then
rm -rf $LOG_DIR/../$symlink
( cd $LOG_DIR/.. ; ln -sf pkgtools/$symlink . )
@@ -406,7 +412,8 @@ remove_packages() {
# If there is an uninstall script, run it here:
if [ -r $TMP/$PKGNAME ]; then
cd $ROOT/ ; sh $TMP/$PKGNAME
- rm -f $TMP/$PKGNAME
+ # Move the uninstall script to $LOG_DIR/removed_uninstall_scripts:
+ mv $TMP/$PKGNAME $LOG_DIR/removed_uninstall_scripts
fi
# In the case where a library and symlink are removed but an earlier version
# remains on the machine, this will link it up and save potential problems:
@@ -423,7 +430,7 @@ remove_packages() {
}
if [ "$#" = "0" ]; then
- echo "Usage: $(basename $0) [--copy] [--keep] [--preserve] [--terse] [--warn] packagename ..."; exit 1
+ echo "Usage: $(basename $0) [--copy] [--keep] [--preserve] [--skip-douninst] [--terse] [--warn] packagename ..."; exit 1
fi
while : ; do
@@ -431,6 +438,7 @@ while : ; do
-copy | --copy) WARN=true; PRESERVE=true; shift;;
-keep | --keep) KEEP=true; shift;;
-preserve | --preserve) PRESERVE=true; shift;;
+ -skip-douninst | --skip-douninst) SKIP_DOUNINST=true; shift;;
-terse | --terse) TERSE=0; shift;;
-warn | --warn) WARN=true; shift;;
-* | --*) echo "Usage: $(basename $0) [-copy] [-keep] [-preserve] [-warn] packagename ..."; exit 1;;