1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

makepkg: Add --verifysource to only download/verify source files

Because --noextract also implies to not download/verify source files, it wasn't
possible to simply do that, without either extracting and/or building.
(Note: --verifysource takes precedence over --noextract)

Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Olivier Brunel 2013-02-23 13:08:44 +01:00 committed by Allan McRae
parent 93fa63ee8a
commit 2259dff7f3
2 changed files with 11 additions and 2 deletions

View File

@ -65,6 +65,11 @@ Options
then make a package out of the result. Keep in mind that creating a then make a package out of the result. Keep in mind that creating a
patch may be a better solution to allow others to use your PKGBUILD. patch may be a better solution to allow others to use your PKGBUILD.
*\--verifysource*::
For each source file in the source array of PKGBUILD, download the file
if required and perform the integrity checks. No extraction or build is
performed. Useful for performing subsequent offline builds.
*-f, \--force*:: *-f, \--force*::
makepkg will not build a package if a built package already exists in makepkg will not build a package if a built package already exists in
the `PKGDEST` (set in linkman:makepkg.conf[5]) directory, which may the `PKGDEST` (set in linkman:makepkg.conf[5]) directory, which may

View File

@ -68,6 +68,7 @@ INSTALL=0
NOBUILD=0 NOBUILD=0
NODEPS=0 NODEPS=0
NOEXTRACT=0 NOEXTRACT=0
VERIFYSOURCE=0
RMDEPS=0 RMDEPS=0
REPKG=0 REPKG=0
LOGGING=0 LOGGING=0
@ -2475,6 +2476,7 @@ usage() {
printf -- "$(gettext " -s, --syncdeps Install missing dependencies with %s")\n" "pacman" printf -- "$(gettext " -s, --syncdeps Install missing dependencies with %s")\n" "pacman"
printf -- "$(gettext " -S, --source Generate a source-only tarball without downloaded sources")\n" printf -- "$(gettext " -S, --source Generate a source-only tarball without downloaded sources")\n"
printf -- "$(gettext " --allsource Generate a source-only tarball including downloaded sources")\n" printf -- "$(gettext " --allsource Generate a source-only tarball including downloaded sources")\n"
printf -- "$(gettext " --verifysource Download source files (if needed) and perform integrity checks")\n"
printf -- "$(gettext " --asroot Allow %s to run as root user")\n" "makepkg" printf -- "$(gettext " --asroot Allow %s to run as root user")\n" "makepkg"
printf -- "$(gettext " --check Run the %s function in the %s")\n" "check()" "$BUILDSCRIPT" printf -- "$(gettext " --check Run the %s function in the %s")\n" "check()" "$BUILDSCRIPT"
printf -- "$(gettext " --config <file> Use an alternate config file (instead of '%s')")\n" "$confdir/makepkg.conf" printf -- "$(gettext " --config <file> Use an alternate config file (instead of '%s')")\n" "$confdir/makepkg.conf"
@ -2525,7 +2527,7 @@ OPT_LONG=('allsource' 'asroot' 'check' 'clean' 'config:' 'force' 'geninteg'
'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'nobuild' 'nocolor' 'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'nobuild' 'nocolor'
'nocheck' 'nodeps' 'noextract' 'nosign' 'pkg:' 'repackage' 'rmdeps' 'nocheck' 'nodeps' 'noextract' 'nosign' 'pkg:' 'repackage' 'rmdeps'
'skipchecksums' 'skipinteg' 'skippgpcheck' 'skippgpcheck' 'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'skippgpcheck' 'sign'
'source' 'syncdeps' 'version') 'source' 'syncdeps' 'verifysource' 'version')
# Pacman Options # Pacman Options
OPT_LONG+=('asdeps' 'noconfirm' 'needed' 'noprogressbar') OPT_LONG+=('asdeps' 'noconfirm' 'needed' 'noprogressbar')
@ -2574,6 +2576,7 @@ while true; do
--sign) SIGNPKG='y' ;; --sign) SIGNPKG='y' ;;
-s|--syncdeps) DEP_BIN=1 ;; -s|--syncdeps) DEP_BIN=1 ;;
-S|--source) SOURCEONLY=1 ;; -S|--source) SOURCEONLY=1 ;;
--verifysource) VERIFYSOURCE=1 ;;
-h|--help) usage; exit 0 ;; # E_OK -h|--help) usage; exit 0 ;; # E_OK
-V|--version) version; exit 0 ;; # E_OK -V|--version) version; exit 0 ;; # E_OK
@ -2951,7 +2954,7 @@ mkdir -p "$srcdir"
chmod a-s "$srcdir" chmod a-s "$srcdir"
cd_safe "$srcdir" cd_safe "$srcdir"
if (( NOEXTRACT )); then if (( NOEXTRACT && ! VERIFYSOURCE )); then
warning "$(gettext "Using existing %s tree")" "src/" warning "$(gettext "Using existing %s tree")" "src/"
elif (( REPKG )); then elif (( REPKG )); then
if (( ! PKGFUNC && ! SPLITPKG )) \ if (( ! PKGFUNC && ! SPLITPKG )) \
@ -2963,6 +2966,7 @@ elif (( REPKG )); then
else else
download_sources download_sources
check_source_integrity check_source_integrity
(( VERIFYSOURCE )) && exit 0 # $E_OK
extract_sources extract_sources
if (( PREPAREFUNC )); then if (( PREPAREFUNC )); then
run_prepare run_prepare