[pacman-dev] [PATCH] 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> --- doc/makepkg.8.txt | 5 +++++ scripts/makepkg.sh.in | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt index 498c79b..87d266b 100644 --- a/doc/makepkg.8.txt +++ b/doc/makepkg.8.txt @@ -65,6 +65,11 @@ Options 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. +*\--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. + *-f, \--force*:: makepkg will not build a package if a built package already exists in the `PKGDEST` (set in linkman:makepkg.conf[5]) directory, which may diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index bd29d73..ce978b1 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -68,6 +68,7 @@ INSTALL=0 NOBUILD=0 NODEPS=0 NOEXTRACT=0 +VERIFYSOURCE=0 RMDEPS=0 REPKG=0 LOGGING=0 @@ -2409,6 +2410,7 @@ usage() { 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 " --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 " --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" @@ -2459,7 +2461,7 @@ OPT_LONG=('allsource' 'asroot' 'check' 'clean' 'config:' 'force' 'geninteg' 'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'nobuild' 'nocolor' 'nocheck' 'nodeps' 'noextract' 'nosign' 'pkg:' 'repackage' 'rmdeps' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'skippgpcheck' 'sign' - 'source' 'syncdeps' 'version') + 'source' 'syncdeps' 'verifysource' 'version') # Pacman Options OPT_LONG+=('asdeps' 'noconfirm' 'needed' 'noprogressbar') @@ -2508,6 +2510,7 @@ while true; do --sign) SIGNPKG='y' ;; -s|--syncdeps) DEP_BIN=1 ;; -S|--source) SOURCEONLY=1 ;; + --verifysource) VERIFYSOURCE=1 ;; -h|--help) usage; exit 0 ;; # E_OK -V|--version) version; exit 0 ;; # E_OK @@ -2885,7 +2888,7 @@ mkdir -p "$srcdir" chmod a-s "$srcdir" cd_safe "$srcdir" -if (( NOEXTRACT )); then +if (( NOEXTRACT && ! VERIFYSOURCE )); then warning "$(gettext "Using existing %s tree")" "src/" elif (( REPKG )); then if (( ! PKGFUNC && ! SPLITPKG )) \ @@ -2897,6 +2900,7 @@ elif (( REPKG )); then else download_sources check_source_integrity + (( VERIFYSOURCE )) && exit 0 # $E_OK extract_sources if (( PREPAREFUNC )); then run_prepare -- 1.8.1.4
On 23/02/13 22:08, Olivier Brunel wrote:
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
--- doc/makepkg.8.txt | 5 +++++ scripts/makepkg.sh.in | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt index 498c79b..87d266b 100644 --- a/doc/makepkg.8.txt +++ b/doc/makepkg.8.txt @@ -65,6 +65,11 @@ Options 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.
+*\--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.
I added a clarification here that it is "Useful for performing subsequent offline builds.".
On Sat, Feb 23, 2013 at 01:08:44PM +0100, Olivier Brunel wrote:
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> --- doc/makepkg.8.txt | 5 +++++ scripts/makepkg.sh.in | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
<SNIP>
-if (( NOEXTRACT )); then +if (( NOEXTRACT && ! VERIFYSOURCE )); then warning "$(gettext "Using existing %s tree")" "src/" elif (( REPKG )); then if (( ! PKGFUNC && ! SPLITPKG )) \ @@ -2897,6 +2900,7 @@ elif (( REPKG )); then else download_sources check_source_integrity + (( VERIFYSOURCE )) && exit 0 # $E_OK
Right here. I know that it might still be useful to download VCS packages for some odd reason, but I think this should look more like else if (( VERIFYSOURCE )); then download_sources fast else download_sources fi (( VERIFYSOURCE )) && exit 0 # $E_OK This would skip the vcs sources, which shouldn't have checksums to verify at all.
extract_sources if (( PREPAREFUNC )); then run_prepare -- 1.8.1.4
-- William Giokas | KaiSforza GnuPG Key: 0x73CD09CF Fingerprint: F73F 50EF BBE2 9846 8306 E6B8 6902 06D8 73CD 09CF
On 10/03/13 08:56, William Giokas wrote:
On Sat, Feb 23, 2013 at 01:08:44PM +0100, Olivier Brunel wrote:
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> --- doc/makepkg.8.txt | 5 +++++ scripts/makepkg.sh.in | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
<SNIP>
-if (( NOEXTRACT )); then +if (( NOEXTRACT && ! VERIFYSOURCE )); then warning "$(gettext "Using existing %s tree")" "src/" elif (( REPKG )); then if (( ! PKGFUNC && ! SPLITPKG )) \ @@ -2897,6 +2900,7 @@ elif (( REPKG )); then else download_sources check_source_integrity + (( VERIFYSOURCE )) && exit 0 # $E_OK
Right here. I know that it might still be useful to download VCS packages for some odd reason, but I think this should look more like
else if (( VERIFYSOURCE )); then download_sources fast else download_sources fi (( VERIFYSOURCE )) && exit 0 # $E_OK
This would skip the vcs sources, which shouldn't have checksums to verify at all.
That removes the ability to easily download sources for future offline builds, which was the only reason I accepted this...
On Sun, Mar 10, 2013 at 09:08:28AM +1000, Allan McRae wrote:
On 10/03/13 08:56, William Giokas wrote:
On Sat, Feb 23, 2013 at 01:08:44PM +0100, Olivier Brunel wrote:
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> --- doc/makepkg.8.txt | 5 +++++ scripts/makepkg.sh.in | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
<SNIP>
-if (( NOEXTRACT )); then +if (( NOEXTRACT && ! VERIFYSOURCE )); then warning "$(gettext "Using existing %s tree")" "src/" elif (( REPKG )); then if (( ! PKGFUNC && ! SPLITPKG )) \ @@ -2897,6 +2900,7 @@ elif (( REPKG )); then else download_sources check_source_integrity + (( VERIFYSOURCE )) && exit 0 # $E_OK
Right here. I know that it might still be useful to download VCS packages for some odd reason, but I think this should look more like
else if (( VERIFYSOURCE )); then download_sources fast else download_sources fi (( VERIFYSOURCE )) && exit 0 # $E_OK
This would skip the vcs sources, which shouldn't have checksums to verify at all.
That removes the ability to easily download sources for future offline builds, which was the only reason I accepted this...
But for that we have -o... -- William Giokas | KaiSforza GnuPG Key: 0x73CD09CF Fingerprint: F73F 50EF BBE2 9846 8306 E6B8 6902 06D8 73CD 09CF
On 10/03/13 09:20, William Giokas wrote:
On Sun, Mar 10, 2013 at 09:08:28AM +1000, Allan McRae wrote:
On 10/03/13 08:56, William Giokas wrote:
On Sat, Feb 23, 2013 at 01:08:44PM +0100, Olivier Brunel wrote:
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> --- doc/makepkg.8.txt | 5 +++++ scripts/makepkg.sh.in | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
<SNIP>
-if (( NOEXTRACT )); then +if (( NOEXTRACT && ! VERIFYSOURCE )); then warning "$(gettext "Using existing %s tree")" "src/" elif (( REPKG )); then if (( ! PKGFUNC && ! SPLITPKG )) \ @@ -2897,6 +2900,7 @@ elif (( REPKG )); then else download_sources check_source_integrity + (( VERIFYSOURCE )) && exit 0 # $E_OK
Right here. I know that it might still be useful to download VCS packages for some odd reason, but I think this should look more like
else if (( VERIFYSOURCE )); then download_sources fast else download_sources fi (( VERIFYSOURCE )) && exit 0 # $E_OK
This would skip the vcs sources, which shouldn't have checksums to verify at all.
That removes the ability to easily download sources for future offline builds, which was the only reason I accepted this...
But for that we have -o...
Which extracts files. And -e does not check checksums... Check the comments in the mailing list archives where we went through all this already.
participants (3)
-
Allan McRae
-
Olivier Brunel
-
William Giokas