summaryrefslogtreecommitdiffstats
path: root/source/a/pkgtools/scripts/installpkg
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/installpkg
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/installpkg')
-rw-r--r--source/a/pkgtools/scripts/installpkg32
1 files changed, 30 insertions, 2 deletions
diff --git a/source/a/pkgtools/scripts/installpkg b/source/a/pkgtools/scripts/installpkg
index b777442a5..0d82f89c0 100644
--- a/source/a/pkgtools/scripts/installpkg
+++ b/source/a/pkgtools/scripts/installpkg
@@ -21,6 +21,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Mon Jun 4 21:17:58 UTC 2018
+# Migrate the package database and directories from /var/log to
+# /var/lib/pkgtools. /var/log was never a good place for this data, as it is
+# considered by many to be a directory that could be wiped to free up some
+# space. Originally the package database was in /var/adm, but the FSSTND
+# (later FHS) group decided that directory should be a symlink to /var/log,
+# and I went along with that since it was years ago and I was a n00b and didn't
+# know any better. /var/lib/pkgtools will be a better and safer location.
+#
# Thu May 24 20:23:55 UTC 2018
# Added --terselength option to set the line length in --terse mode.
# Allow adding NOLOCK in an install script to allow it to run without locking.
@@ -254,14 +263,33 @@ while [ 0 ]; do
done
# Set the prefix for the package database directories (packages, scripts).
-ADM_DIR="$ROOT/var/log"
+ADM_DIR="$ROOT/var/lib/pkgtools"
+
+# Set the prefix for the removed packages/scripts log files:
+LOG_DIR="$ROOT/var/log/pkgtools"
+
# If the directories don't exist, "initialize" the package database:
-for PKGDBDIR in packages removed_packages removed_scripts scripts setup ; do
+for PKGDBDIR in packages scripts setup ; do
if [ ! -d $ADM_DIR/$PKGDBDIR ]; then
mkdir -p $ADM_DIR/$PKGDBDIR
chmod 755 $ADM_DIR/$PKGDBDIR
fi
done
+for PKGLOGDIR in removed_packages removed_scripts ; do
+ if [ ! -d $LOG_DIR/$PKGLOGDIR ]; then
+ rm -rf $LOG_DIR/$PKGLOGDIR # make sure it's not a symlink or something stupid
+ mkdir -p $LOG_DIR/$PKGLOGDIR
+ chmod 755 $LOG_DIR/$PKGLOGDIR
+ fi
+done
+# Likewise, make sure that the symlinks in /var/log exist. We no longer
+# trust anything to remain in /var/log. Let the admin wipe it if that's
+# what they like.
+for symlink in packages scripts setup ; do
+ if [ ! -L $LOG_DIR/../$symlink -a ! -d $LOG_DIR/../$symlink ]; then
+ ( cd $LOG_DIR/.. ; ln -sf ../lib/pkgtools/$symlink . )
+ fi
+done
# Make sure there's a proper temp directory:
TMP=$ADM_DIR/setup/tmp