summaryrefslogtreecommitdiffstats
path: root/source/a/pkgtools/scripts/upgradepkg
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/pkgtools/scripts/upgradepkg')
-rw-r--r--source/a/pkgtools/scripts/upgradepkg25
1 files changed, 24 insertions, 1 deletions
diff --git a/source/a/pkgtools/scripts/upgradepkg b/source/a/pkgtools/scripts/upgradepkg
index d71ca4b03..9ae3ce204 100644
--- a/source/a/pkgtools/scripts/upgradepkg
+++ b/source/a/pkgtools/scripts/upgradepkg
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999 Patrick Volkerding, Moorhead, Minnesota, USA
# Copyright 2001, 2002, 2003 Slackware Linux, Inc., Concord, California, USA
-# Copyright 2009, 2015 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2009, 2015, 2021 Patrick J. Volkerding, Sebeka, MN, USA
# Copyright 2015 Michal Nazarewicz <mina86@mina86.com>
# All rights reserved.
#
@@ -22,6 +22,11 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Wed May 19 04:46:53 UTC 2021
+# export PRE_INSTALL_PASS="true" if we'll be running installpkg a second time
+# for each package. Perhaps then we could skip some expensive install script
+# functions until the final pass. Thanks to Stuart Winter.
+#
# Mon Jun 4 21:17:58 UTC 2018
# Use /var/lib/pkgtools, not /var/log.
#
@@ -353,7 +358,14 @@ EOF
+==============================================================================
EOF
fi
+
# Next, the new package is pre-installed:
+
+ # Signal to the install script that this is a pre-install, in case it cares:
+ if [ ! "$NOT_PARANOID" = "true" ]; then
+ export PRE_INSTALL_PASS="true"
+ fi
+
if [ "$VERBOSE" = "verbose" ]; then
if ! [ $TERSE ]; then
/sbin/installpkg $INCOMINGDIR/$NNAME
@@ -379,6 +391,17 @@ EOF
RETCODE=$?
fi
fi
+
+ # At this stage, if the operator supplied --no-paranoia, the package
+ # installation process (as far as unpacking content and running setup scripts
+ # is concerned) is complete.
+ # By default there will be a second and final installation pass, and to avoid
+ # executing expensive actions (such as re-generating data files or creating
+ # a large number of symlinks) installpkg skips running the install script on
+ # that first pass. Now we'll unset the PRE_INSTALL_PASS environment variable
+ # so that installpkg will run the install script.
+ unset PRE_INSTALL_PASS
+
# Make sure that worked:
if [ ! $RETCODE = 0 ]; then
echo "ERROR: Package $INCOMINGDIR/$NNAME did not install"