While looking at installpkg, I noticed that it uses --transform twice when calling tar, once to replace "^install$" and again to replace "^install/". It seemed a simple matter to combine the two uses of --transform.
Also I noticed a comment referencing the nonexistent --attrs option to tar, which from context appears to really mean --acls.
The following patch addresses the above two admittedly trivial findings.
Code:
--- a/installpkg 2019-05-11 15:23:23.106651376 -0500
+++ b/installpkg 2019-05-11 15:26:56.153783418 -0500
@@ -121,7 +121,7 @@
# If we have mcookie and a tar that is recent enough to support --transform,
# then we can stop needlessly erasing files in the /install directory while
# also making installpkg thread-safe. Don't check for recent tar - we'll
-# already break from --attrs and --xattrs anyway if the wrong tar is used.
+# already break from --acls and --xattrs anyway if the wrong tar is used.
if which mcookie 1> /dev/null 2> /dev/null ; then
MCOOKIE=$(mcookie)
INSTDIR=installpkg-${MCOOKIE}
@@ -627,7 +627,7 @@
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
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\1," --acls --xattrs --xattrs-include='*' --keep-directory-symlink -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.