LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-11-2019, 03:33 PM   #1
andygoth
Member
 
Registered: Sep 2017
Distribution: Slackware
Posts: 40

Rep: Reputation: 25
Silly patch to installpkg


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.
 
  


Reply

Tags
installpkg


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] [PATCH] tar issuing a SIGPIPE in installpkg NonNonBa Slackware 1 09-07-2018 10:25 AM
[PATCH 1/1] installpkg: make TERSE aware Xsane Slackware 2 06-30-2018 09:41 PM
Installpkg question BittaBrotha Slackware 3 05-28-2003 12:57 AM
Installing glibc-2.3 with installpkg Wynd Slackware 2 04-01-2003 07:13 PM
Slackware 8.1: "installpkg" command not working? tigerflag Slackware 5 10-12-2002 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration