summaryrefslogtreecommitdiffstats
path: root/source/a/pkgtools/scripts/removepkg
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2018-06-21 22:58:42 +0000
committer Eric Hameleers <alien@slackware.com>2018-06-22 09:00:34 +0200
commitca85aab95397ae918088f8ba2195eb4eb996c739 (patch)
tree53c83f5d50354f163eeab5dd11c8ba109be9e291 /source/a/pkgtools/scripts/removepkg
parentb893b1174dfcd0fdc84aa597eee76b797d6d7b11 (diff)
downloadcurrent-ca85aab95397ae918088f8ba2195eb4eb996c739.tar.gz
current-ca85aab95397ae918088f8ba2195eb4eb996c739.tar.xz
Thu Jun 21 22:58:42 UTC 201820180621225842
a/pkgtools-15.0-noarch-20.txz: Rebuilt. Move pkgtools database to /var/lib/pkgtools/. Move removed logs to /var/log/pkgtools/. a/sysvinit-2.90-x86_64-1.txz: Upgraded. ap/cups-filters-1.20.3-x86_64-3.txz: Rebuilt. Recompiled against poppler-0.66.0. kde/calligra-2.9.11-x86_64-22.txz: Rebuilt. Recompiled against poppler-0.66.0. l/dbus-python-1.2.8-x86_64-1.txz: Upgraded. l/gc-7.6.6-x86_64-1.txz: Upgraded. l/harfbuzz-1.8.1-x86_64-1.txz: Upgraded. l/poppler-0.66.0-x86_64-1.txz: Upgraded. Shared library .so-version bump. l/pulseaudio-12.0-x86_64-1.txz: Upgraded. n/dhcpcd-7.0.6-x86_64-1.txz: Upgraded. n/php-7.2.7-x86_64-1.txz: Upgraded. Added support for libedit. t/texlive-2017.171108-x86_64-7.txz: Rebuilt. Recompiled against poppler-0.66.0. x/libwacom-0.30-x86_64-1.txz: Upgraded. xfce/exo-0.12.2-x86_64-1.txz: Upgraded. xfce/tumbler-0.2.1-x86_64-4.txz: Rebuilt. Recompiled against poppler-0.66.0. xfce/xfce4-settings-4.12.4-x86_64-1.txz: Upgraded.
Diffstat (limited to 'source/a/pkgtools/scripts/removepkg')
-rw-r--r--source/a/pkgtools/scripts/removepkg31
1 files changed, 25 insertions, 6 deletions
diff --git a/source/a/pkgtools/scripts/removepkg b/source/a/pkgtools/scripts/removepkg
index 6312353ac..b033eebf2 100644
--- a/source/a/pkgtools/scripts/removepkg
+++ b/source/a/pkgtools/scripts/removepkg
@@ -3,7 +3,7 @@
#
# Copyright 1994, 1995, 1998 Patrick Volkerding, Moorhead, Minnesota USA
# Copyright 2001, Slackware Linux, Inc., Concord, CA USA
-# Copyright 2009, 2015, 2016 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2009, 2015, 2016, 2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -24,6 +24,11 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Tue Jun 5 20:04:45 UTC 2018
+# Use /var/lib/pkgtools for the package database, not /var/log.
+# Logs of the removed packages and scripts will remain in /var/log, but moved
+# into /var/log/pkgtools.
+#
# Sun May 27 18:02:23 UTC 2018
# Added --terse mode to print one line per removed package.
#
@@ -133,14 +138,19 @@ pkgbase() {
# This makes "sort" run much faster:
export LC_ALL=C
+# Set the prefix for the package database directories (packages, scripts).
+ADM_DIR="$ROOT/var/lib/pkgtools"
+
+# Set the prefix for the removed packages/scripts log files:
+LOG_DIR="$ROOT/var/log/pkgtools"
+
# Make sure there's a proper temp directory:
-TMP=$ROOT/var/log/setup/tmp
+TMP=$ADM_DIR/setup/tmp
# If the $TMP directory doesn't exist, create it:
if [ ! -d $TMP ]; then
mkdir -p $TMP
chmod 700 $TMP # no need to leave it open
fi
-ADM_DIR=$ROOT/var/log
PRES_DIR=$TMP/preserved_packages
# Lock directory for ldconfig... share it with installpkg so that upgradepkg
@@ -366,10 +376,19 @@ remove_packages() {
fi
fi
if [ ! "$WARN" = "true" ]; then
- mkdir -p $ADM_DIR/removed_packages $ADM_DIR/removed_scripts
- mv $ADM_DIR/packages/$PKGNAME $ADM_DIR/removed_packages
+ # 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
+ if [ ! -L $LOG_DIR/../$symlink ]; then
+ rm -rf $LOG_DIR/../$symlink
+ ( cd $LOG_DIR/.. ; ln -sf pkgtools/$symlink . )
+ fi
+ done
+ # Now that we know we have log directories, move the files:
+ mv $ADM_DIR/packages/$PKGNAME $LOG_DIR/removed_packages
if [ -r $ADM_DIR/scripts/$PKGNAME ]; then
- mv $ADM_DIR/scripts/$PKGNAME $ADM_DIR/removed_scripts
+ mv $ADM_DIR/scripts/$PKGNAME $LOG_DIR/removed_scripts
fi
fi
else