summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Neidhardt <ambrevar@gmail.com>2014-03-03 20:29:54 +0100
committerAllan McRae <allan@archlinux.org>2014-03-12 13:13:49 +1000
commitce3fbcb18d176d45df0c0f54299022e55509595f (patch)
tree6f24820420861f1ea09fdfaab14325ca7ad67609
parent204158682910556b3e5e53906dcfaf063ab0e195 (diff)
downloadpacman-ce3fbcb18d176d45df0c0f54299022e55509595f.tar.xz
makepkg: Add a --noarchive option to inhibit archive creation
1. Packagers who want to test the package() function, i.e. to check the content of the pkg/ folder. 2. Developers who want to check how the packaged version of a program looks, in other words how the pkg/ folder looks. 3. For users of systems with no port tree, makepkg can ease package creation. However the resulting archive of the whole makepkg process is often useless. For all situations, makepkg will usually be called several times. But no archive (the final package) is needed in any cases. The archive creation ends up being a waste of time and resource, especially for big applications and slow machines. Since this option aborts the process prematurely, it behaves like the -o,--nobuild option, i.e. any other option acting on later stages in the process will be automatically discarded. For --noarchive, it means that in $ makepkg --noarchive --install the '--install' option does not do anything. Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--doc/makepkg.8.txt5
-rw-r--r--scripts/makepkg.sh.in21
2 files changed, 21 insertions, 5 deletions
diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt
index 77a7a834..4b3cbbdf 100644
--- a/doc/makepkg.8.txt
+++ b/doc/makepkg.8.txt
@@ -165,6 +165,11 @@ Options
Run the check() function in the PKGBUILD, overriding the setting in
linkman:makepkg.conf[5].
+*\--noarchive*::
+ Do not create the archive at the end of the build process. This can be
+ useful to test the package() function or if your target distribution does
+ not use pacman.
+
*\--nocheck*::
Do not run the check() function in the PKGBUILD or handle the checkdepends.
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 20c7243a..8a07942c 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -74,6 +74,7 @@ INFAKEROOT=0
INSTALL=0
LOGGING=0
NEEDED=0
+NOARCHIVE=0
NOBUILD=0
NODEPS=0
NOEXTRACT=0
@@ -1868,6 +1869,8 @@ write_pkginfo() {
}
create_package() {
+ (( NOARCHIVE )) && return
+
if [[ ! -d $pkgdir ]]; then
error "$(gettext "Missing %s directory.")" "\$pkgdir/"
plain "$(gettext "Aborting...")"
@@ -2404,7 +2407,7 @@ check_build_status() {
fullver=$(get_full_version)
pkgarch=$(get_pkg_arch)
if [[ -f $PKGDEST/${pkgname}-${fullver}-${pkgarch}${PKGEXT} ]] \
- && ! (( FORCE || SOURCEONLY || NOBUILD )); then
+ && ! (( FORCE || SOURCEONLY || NOBUILD || NOARCHIVE)); then
if (( INSTALL )); then
warning "$(gettext "A package has already been built, installing existing package...")"
install_package
@@ -2426,7 +2429,7 @@ check_build_status() {
allpkgbuilt=0
fi
done
- if ! (( FORCE || SOURCEONLY || NOBUILD )); then
+ if ! (( FORCE || SOURCEONLY || NOBUILD || NOARCHIVE)); then
if (( allpkgbuilt )); then
if (( INSTALL )); then
warning "$(gettext "The package group has already been built, installing existing packages...")"
@@ -2538,6 +2541,7 @@ usage() {
printf -- "$(gettext " --config <file> Use an alternate config file (instead of '%s')")\n" "$confdir/makepkg.conf"
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 " --noarchive Do not create package archive")\n"
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"
@@ -2584,9 +2588,9 @@ ARGLIST=("$@")
# Parse Command Line Options.
OPT_SHORT="AcCdefFghiLmop:rRsSV"
OPT_LONG=('allsource' 'asroot' 'check' 'clean' 'cleanbuild' 'config:' 'force' 'geninteg'
- 'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'nobuild' 'nocolor'
- 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'pkg:' 'repackage' 'rmdeps'
- 'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'source' 'syncdeps'
+ 'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'noarchive' 'nobuild'
+ 'nocolor' 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'pkg:' 'repackage'
+ 'rmdeps' 'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'source' 'syncdeps'
'verifysource' 'version')
# Pacman Options
@@ -2624,6 +2628,7 @@ while true; do
--key) shift; GPGKEY=$1 ;;
-L|--log) LOGGING=1 ;;
-m|--nocolor) USE_COLOR='n' ;;
+ --noarchive) NOARCHIVE=1 ;;
--nocheck) RUN_CHECK='n' ;;
--noprepare) RUN_PREPARE='n' ;;
--nosign) SIGNPKG='n' ;;
@@ -3081,6 +3086,12 @@ else
fi
fi
+# if inhibiting archive creation, go no further
+if (( NOARCHIVE )); then
+ msg "$(gettext "Package folder is ready.")"
+ exit 0
+fi
+
fullver=$(get_full_version)
msg "$(gettext "Finished making: %s")" "$pkgbase $fullver ($(date))"