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/installpkg26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/a/pkgtools/scripts/installpkg b/source/a/pkgtools/scripts/installpkg
index e7fa21c03..ee76cf134 100644
--- a/source/a/pkgtools/scripts/installpkg
+++ b/source/a/pkgtools/scripts/installpkg
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1994, 1998, 2000 Patrick Volkerding, Concord, CA, USA
# Copyright 2001, 2003 Slackware Linux, Inc., Concord, CA, USA
-# Copyright 2007, 2009, 2011, 2017, 2018, 2019, 2020 Patrick Volkerding, Sebeka, MN, USA
+# Copyright 2007, 2009, 2011, 2017, 2018, 2019, 2020, 2021 Patrick Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,6 +21,17 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Thu May 20 18:55:21 UTC 2021
+# Add support for the flag ALWAYS_RUN_INSTALL_SCRIPT in doinst.sh. If it
+# appears, then the install script will always be run, even in the pre-install
+# pass.
+#
+# Wed May 19 18:11:44 UTC 2021
+# Don't run the install script if this is a pre-install pass as indicated by
+# upgradepkg setting PRE_INSTALL_PASS="true". Some of the install scripts can
+# take a significant amount of time to process, and there aren't any known
+# cases where they actually need to be run twice.
+#
# Wed Apr 1 21:59:41 UTC 2020
# If the package contains /install/douninst.sh, copy the uninstall script to
# $ADM_DIR/douninst.sh/$shortname and add the filename to the package list
@@ -667,7 +678,20 @@ EOF
) 9> $INSTLOCKDIR/ldconfig.lock
fi
+ # If we see ALWAYS_RUN_INSTALL_SCRIPT in the install script, then we'll
+ # unset PRE_INSTALL_PASS to ensure that the install script will be run even
+ # in a pre-install pass. We haven't found any case yet where skipping the
+ # install script in the pre-install pass breaks a package upgrade, but we'll
+ # add the ability to not skip it so there's a workaround if any corner cases
+ # emerge. Sorry to violate YAGNI like this. ;-)
if [ -f $ROOT/$INSTDIR/doinst.sh ]; then
+ if grep -q ALWAYS_RUN_INSTALL_SCRIPT $ROOT/$INSTDIR/doinst.sh ; then
+ unset PRE_INSTALL_PASS
+ fi
+ fi
+
+ # Run the install script if one exists and this isn't a pre-install pass:
+ if [ -f $ROOT/$INSTDIR/doinst.sh -a ! "$PRE_INSTALL_PASS" = "true" ]; then
if [ "$MODE" = "install" ]; then
echo "Executing install script for $(basename $package)."
fi