1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-11 20:05:07 -05:00

makepkg: Use SKIP in checksum to skip integrity check

Using the value of "SKIP" in the checksum array will cause that
integrity check to be skipped.  This makes building packages that
rely on user configurable sources less painful.

Based-on-patch-by: Dan McGee <dan@archlinux.org>
Based-on-patch-by: David Campbell <davekong@archlinux.us>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2011-12-22 16:51:22 +10:00 committed by Dan McGee
parent a77e638c77
commit 1b46137426
2 changed files with 15 additions and 10 deletions

View File

@ -120,9 +120,10 @@ of the corresponding source file.
*md5sums (array)*:: *md5sums (array)*::
This array contains an MD5 hash for every source file specified in the This array contains an MD5 hash for every source file specified in the
source array (in the same order). makepkg will use this to verify source source array (in the same order). makepkg will use this to verify source
file integrity during subsequent builds. To easily generate md5sums, run file integrity during subsequent builds. If 'SKIP' is put in the array
`makepkg -g >> PKGBUILD`. If desired, move the md5sums line to an in place of a normal hash, the integrity check for that source file will
appropriate location. be skipped. To easily generate md5sums, run ``makepkg -g >> PKGBUILD''.
If desired, move the md5sums line to an appropriate location.
*sha1sums, sha256sums, sha384sums, sha512sums (arrays)*:: *sha1sums, sha256sums, sha384sums, sha512sums (arrays)*::
Alternative integrity checks that makepkg supports; these all behave Alternative integrity checks that makepkg supports; these all behave

View File

@ -663,14 +663,18 @@ check_checksums() {
fi fi
if (( $found )) ; then if (( $found )) ; then
local expectedsum=$(tr '[:upper:]' '[:lower:]' <<< "${integrity_sums[$idx]}") if [[ ${integrity_sums[$idx]} = 'SKIP' ]]; then
local realsum="$(openssl dgst -${integ} "$file")" echo "$(gettext "Skipped")" >&2
realsum="${realsum##* }"
if [[ $expectedsum = $realsum ]]; then
echo "$(gettext "Passed")" >&2
else else
echo "$(gettext "FAILED")" >&2 local expectedsum=$(tr '[:upper:]' '[:lower:]' <<< "${integrity_sums[$idx]}")
errors=1 local realsum="$(openssl dgst -${integ} "$file")"
realsum="${realsum##* }"
if [[ $expectedsum = $realsum ]]; then
echo "$(gettext "Passed")" >&2
else
echo "$(gettext "FAILED")" >&2
errors=1
fi
fi fi
fi fi