summaryrefslogtreecommitdiffstats
path: root/source/a/pkgtools/scripts/installpkg
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/pkgtools/scripts/installpkg')
-rw-r--r--source/a/pkgtools/scripts/installpkg20
1 files changed, 16 insertions, 4 deletions
diff --git a/source/a/pkgtools/scripts/installpkg b/source/a/pkgtools/scripts/installpkg
index 2180016f5..f334728c6 100644
--- a/source/a/pkgtools/scripts/installpkg
+++ b/source/a/pkgtools/scripts/installpkg
@@ -1,7 +1,7 @@
#!/bin/sh
# Copyright 1994, 1998, 2000 Patrick Volkerding, Concord, CA, USA
# Copyright 2001, 2003 Slackware Linux, Inc., Concord, CA, USA
-# Copyright 2007, 2009, 2011, 2017, 2018 Patrick Volkerding, Sebeka, MN, USA
+# Copyright 2007, 2009, 2011, 2017, 2018, 2019 Patrick Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,6 +21,9 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Fri Oct 4 06:04:39 UTC 2019
+# Add support for --no-overwrite so that upgradepkg can be kind to SSDs.
+#
# 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
@@ -163,13 +166,19 @@ options: --warn (warn if files will be overwritten, but do not install)
--tagfile /somedir/tagfile (specify a different file to use
for package priorities. The default is "tagfile" in
the package's directory)
- --threads <number> For xz/plzip compressed packages, set the max
+ --threads <number> For xz/plzip compressed packages, set the max
number of threads to be used for decompression. Only has
an effect if a multithreaded compressor was used, and then
only on large packages. For plzip, the default is equal to
the number of CPU threads available on the machine. For xz,
the default is equal to 2.
--md5sum (record the package's md5sum in the metadata file)
+ --no-overwrite When extracting the package, do not overwrite
+ existing files. Usually, this option should not be used.
+ It exists so that upgradepkg can use it for the second
+ installation pass. The first pass has already overwritten
+ the previous package's files, and this will catch the few
+ corner cases without generating unnecessary writes.
EOF
}
@@ -227,6 +236,9 @@ while [ 0 ]; do
elif [ "$1" = "-ask" -o "$1" = "--ask" ]; then
ALWAYSASK="yes"
shift 1
+ elif [ "$1" = "--no-overwrite" ]; then
+ NO_OVERWRITE=" --skip-old-files "
+ shift 1
elif [ "$1" = "-tagfile" -o "$1" = "--tagfile" ]; then
if [ -r "$2" ]; then
USERTAGFILE="$2"
@@ -625,9 +637,9 @@ EOF
fi
echo "FILE LIST:" >> $ADM_DIR/packages/$shortname
if [ "$INSTDIR" = "install" ]; then
- ( cd $ROOT/ ; $packagecompression -dc | tar --acls --xattrs --xattrs-include='*' --keep-directory-symlink -xpvf - | LC_ALL=C sort ) < $package >> $TMP/$shortname 2> /dev/null
+ ( cd $ROOT/ ; $packagecompression -dc | tar --acls --xattrs --xattrs-include='*' --keep-directory-symlink $NO_OVERWRITE -xpvf - | LC_ALL=C sort ) < $package >> $TMP/$shortname 2> /dev/null
else
- ( cd $ROOT/ ; $packagecompression -dc | tar --transform "s,^install$,$INSTDIR," --transform "s,^install/,$INSTDIR/," --acls --xattrs --xattrs-include='*' --keep-directory-symlink -xpvf - | LC_ALL=C sort ) < $package >> $TMP/$shortname 2> /dev/null
+ ( cd $ROOT/ ; $packagecompression -dc | tar --transform "s,^install$,$INSTDIR," --transform "s,^install/,$INSTDIR/," --acls --xattrs --xattrs-include='*' --keep-directory-symlink $NO_OVERWRITE -xpvf - | LC_ALL=C sort ) < $package >> $TMP/$shortname 2> /dev/null
fi
if [ "$( grep '^\./' $TMP/$shortname | wc -l | tr -d ' ')" = "1" ]; then
# Good. We have a package that meets the Slackware spec.