[pacman-dev] [PATCH] makepkg: Add '--nocompress' syntactic sugar

Jouke Witteveen j.witteveen at gmail.com
Sat May 18 11:34:40 UTC 2019


Compression is a waste of time when building a package for local
installation. It could already be suppressed easily, but not yet
via an argument to makepkg.

Signed-off-by: Jouke Witteveen <j.witteveen at gmail.com>
---

The OPT_LONG array should probably be reformatted, but that could as
well happen separately. At any rate it is not clear to me what the
guiding principles would be.

 doc/makepkg.8.asciidoc                | 4 ++++
 scripts/completion/bash_completion.in | 4 ++--
 scripts/makepkg.sh.in                 | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/doc/makepkg.8.asciidoc b/doc/makepkg.8.asciidoc
index 544659fc..86e1960a 100644
--- a/doc/makepkg.8.asciidoc
+++ b/doc/makepkg.8.asciidoc
@@ -165,6 +165,10 @@ Options
 *\--nocheck*::
 	Do not run the check() function in the PKGBUILD or handle the checkdepends.
 
+*\--nocompress*::
+	Do not compress the package. Equivalent to setting PKGEXT=".pkg.tar" and
+    SRCEXT=".src.tar".
+
 *\--noprepare*::
 	Do not run the prepare() function in the PKGBUILD.
 
diff --git a/scripts/completion/bash_completion.in b/scripts/completion/bash_completion.in
index a1ab9fec..30d5c683 100644
--- a/scripts/completion/bash_completion.in
+++ b/scripts/completion/bash_completion.in
@@ -80,8 +80,8 @@ _makepkg() {
   elif [[ ! $prev =~ ^-(-(config|help|key|version)$|\w*[Vh]) ]]; then
     opts=('allsource asdeps check clean cleanbuild config force geninteg help
            holdver ignorearch install key log needed noarchive nobuild nocheck
-           nocolor noconfirm nodeps noextract noprepare noprogressbar nosign
-           packagelist printsrcinfo repackage rmdeps sign skipchecksums
+           nocolor nocompress noconfirm nodeps noextract noprepare noprogressbar
+           nosign packagelist printsrcinfo repackage rmdeps sign skipchecksums
            skipinteg skippgpcheck source syncdeps verifysource version'
           'A C L R S c d e f g h i m o p r s')
     _arch_ptr2comp opts
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 4d9948ec..953b5e36 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -977,6 +977,7 @@ usage() {
 	printf -- "$(gettext "  --key <key>      Specify a key to use for %s signing instead of the default")\n" "gpg"
 	printf -- "$(gettext "  --noarchive      Do not create package archive")\n"
 	printf -- "$(gettext "  --nocheck        Do not run the %s function in the %s")\n" "check()" "$BUILDSCRIPT"
+	printf -- "$(gettext "  --nocompress     Do not compress the package archive")\n"
 	printf -- "$(gettext "  --noprepare      Do not run the %s function in the %s")\n" "prepare()" "$BUILDSCRIPT"
 	printf -- "$(gettext "  --nosign         Do not create a signature for the package")\n"
 	printf -- "$(gettext "  --packagelist    Only list package filepaths that would be produced")\n"
@@ -1026,7 +1027,7 @@ ARGLIST=("$@")
 OPT_SHORT="AcCdefFghiLmop:rRsSV"
 OPT_LONG=('allsource' 'check' 'clean' 'cleanbuild' 'config:' 'force' 'geninteg'
           'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'noarchive' 'nobuild'
-          'nocolor' 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'packagelist'
+          'nocolor' 'nocheck' 'nocompress' 'nodeps' 'noextract' 'noprepare' 'nosign' 'packagelist'
           'printsrcinfo' 'repackage' 'rmdeps' 'sign' 'skipchecksums' 'skipinteg'
           'skippgpcheck' 'source' 'syncdeps' 'verifysource' 'version')
 
@@ -1067,6 +1068,7 @@ while true; do
 		-m|--nocolor)     USE_COLOR='n'; PACMAN_OPTS+=("--color" "never") ;;
 		--noarchive)      NOARCHIVE=1 ;;
 		--nocheck)        RUN_CHECK='n' ;;
+		--nocompress)     PKGEXT=".pkg.tar"; SRCEXT=".src.tar";;
 		--noprepare)      RUN_PREPARE='n' ;;
 		--nosign)         SIGNPKG='n' ;;
 		-o|--nobuild)     BUILDPKG=0 NOBUILD=1 ;;
-- 
2.21.0


More information about the pacman-dev mailing list