diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2019-10-04 21:35:49 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2019-10-05 08:59:49 +0200 |
commit | daaabd8ee20406533b88fb272e342409ba51190d (patch) | |
tree | ba129884da64efd41c3f8b9dca07ab52a316f0cf /source/a/pkgtools/scripts/installpkg | |
parent | 4599171894453ce9b77106663288c843113f87e0 (diff) | |
download | current-daaabd8ee20406533b88fb272e342409ba51190d.tar.gz |
Fri Oct 4 21:35:49 UTC 201920191004213549
a/pkgtools-15.0-noarch-24.txz: Rebuilt.
installpkg: support --no-overwrite option for upgradepkg's second install
pass. Don't use this option directly unless you have a good reason.
upgradepkg: call installpkg with --no-overwrite for the second install pass.
This cuts the drive writes for a package upgrade almost in half so we can
be kinder to SSDs.
ap/nano-4.5-x86_64-1.txz: Upgraded.
l/gmime-3.2.4-x86_64-1.txz: Upgraded.
l/gnu-efi-3.0.10-x86_64-1.txz: Upgraded.
l/gtk+3-3.24.12-x86_64-1.txz: Upgraded.
testing/packages/rust-1.38.0-x86_64-2.txz: Rebuilt.
The package size here has been put on a tremendous diet.
Thanks to Andrew Clemons and Willy Sudiarto Raharjo for help with this.
Compile test results:
firefox-68.1.0esr: fail
firefox-69.0.2: pass
seamonkey-2.49.5: pass
thunderbird-68.1.1: fail
Diffstat (limited to 'source/a/pkgtools/scripts/installpkg')
-rw-r--r-- | source/a/pkgtools/scripts/installpkg | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source/a/pkgtools/scripts/installpkg b/source/a/pkgtools/scripts/installpkg index 2180016f..f334728c 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. |