[pacman-dev] [PATCH 4/4] Add --noprepare option to makepkg
Eric Bélanger
snowmaniscool at gmail.com
Sun Apr 28 22:42:22 EDT 2013
This new option disables the prepare function. Useful in combination
with -o to get an unpatched copy of the sources for testing purpose.
Signed-off-by: Eric Bélanger <snowmaniscool at gmail.com>
---
contrib/bash_completion.in | 2 +-
contrib/zsh_completion.in | 1 +
doc/makepkg.8.txt | 3 +++
scripts/makepkg.sh.in | 9 +++++++--
test/scripts/parseopts_test.sh | 2 +-
5 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/contrib/bash_completion.in b/contrib/bash_completion.in
index 28981ae..519aa6d 100644
--- a/contrib/bash_completion.in
+++ b/contrib/bash_completion.in
@@ -77,7 +77,7 @@ _makepkg() {
if [[ $cur = -* && ! $prev =~ ^-(-(config|help)$|\w*[Chp]) ]]; then
opts=('allsource asdeps asroot check clean config force geninteg help holdver ignorearch
install key log needed nobuild nocheck nocolor noconfirm nodeps noextract
- noprogressbar nosign pkg repackage rmdeps sign skipchecksums skipinteg
+ noprepare noprogressbar nosign pkg repackage rmdeps sign skipchecksums skipinteg
skippgpcheck source syncdeps verifysource version'
'A L R S c d e f g h i m o p r s')
_arch_ptr2comp opts
diff --git a/contrib/zsh_completion.in b/contrib/zsh_completion.in
index f9d1106..c1fe041 100644
--- a/contrib/zsh_completion.in
+++ b/contrib/zsh_completion.in
@@ -583,6 +583,7 @@ _makepkg_longopts=(
'--holdver[Prevent automatic version bumping for development PKGBUILDs]'
'--key[Specify key to use for gpg signing instead of the default]: :_keys'
'--nocheck[Do not run the check() function in the PKGBUILD]'
+ '--noprepare[Do not run the prepare() function in the PKGBUILD]'
'--nosign[Do not create a signature for the package]'
'--pkg[Only build listed packages from a split package]'
'--sign[Sign the resulting package with gpg]'
diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt
index 53a7867..3f2e24d 100644
--- a/doc/makepkg.8.txt
+++ b/doc/makepkg.8.txt
@@ -165,6 +165,9 @@ Options
*\--nocheck*::
Do not run the check() function in the PKGBUILD or handle the checkdepends.
+*\--noprepare*::
+ Do not run the prepare() function in the PKGBUILD.
+
*\--sign*::
Sign the resulting package with gpg, overriding the setting in
linkman:makepkg.conf[5].
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 710b76b..13f3610 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -2484,6 +2484,7 @@ usage() {
printf -- "$(gettext " --holdver Do not update VCS sources")\n"
printf -- "$(gettext " --key <key> Specify a key to use for %s signing instead of the default")\n" "gpg"
printf -- "$(gettext " --nocheck Do not run the %s function in the %s")\n" "check()" "$BUILDSCRIPT"
+ 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 " --pkg <list> Only build listed packages from a split package")\n"
printf -- "$(gettext " --sign Sign the resulting package with %s")\n" "gpg"
@@ -2526,7 +2527,7 @@ ARGLIST=("$@")
OPT_SHORT="AcdefFghiLmop:rRsSV"
OPT_LONG=('allsource' 'asroot' 'check' 'clean' 'config:' 'force' 'geninteg'
'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'nobuild' 'nocolor'
- 'nocheck' 'nodeps' 'noextract' 'nosign' 'pkg:' 'repackage' 'rmdeps'
+ 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'pkg:' 'repackage' 'rmdeps'
'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'source' 'syncdeps'
'verifysource' 'version')
@@ -2565,6 +2566,7 @@ while true; do
-L|--log) LOGGING=1 ;;
-m|--nocolor) USE_COLOR='n' ;;
--nocheck) RUN_CHECK='n' ;;
+ --noprepare) RUN_PREPARE='n' ;;
--nosign) SIGNPKG='n' ;;
-o|--nobuild) NOBUILD=1 ;;
-p) shift; BUILDFILE=$1 ;;
@@ -2798,7 +2800,10 @@ fi
# test for available PKGBUILD functions
if declare -f prepare >/dev/null; then
- PREPAREFUNC=1
+ # "Hide" prepare() function if not going to be run
+ if [[ $RUN_PREPARE != "n" ]]; then
+ PREPAREFUNC=1
+ fi
fi
if declare -f build >/dev/null; then
BUILDFUNC=1
diff --git a/test/scripts/parseopts_test.sh b/test/scripts/parseopts_test.sh
index 1693b9f..0d894c9 100755
--- a/test/scripts/parseopts_test.sh
+++ b/test/scripts/parseopts_test.sh
@@ -18,7 +18,7 @@ fi
OPT_SHORT="AcdefFghiLmop:rRsV"
OPT_LONG=('allsource' 'asroot' 'ignorearch' 'check' 'clean:' 'cleanall' 'nodeps'
'noextract' 'force' 'forcever:' 'geninteg' 'help' 'holdver'
- 'install' 'key:' 'log' 'nocolor' 'nobuild' 'nocheck' 'nosign' 'pkg:' 'rmdeps'
+ 'install' 'key:' 'log' 'nocolor' 'nobuild' 'nocheck' 'noprepare' 'nosign' 'pkg:' 'rmdeps'
'repackage' 'skipinteg' 'sign' 'source' 'syncdeps' 'version' 'config:'
'noconfirm' 'noprogressbar')
--
1.8.2.2
More information about the pacman-dev
mailing list