diff options
-rw-r--r-- | commitpkg.in | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/commitpkg.in b/commitpkg.in index 08f2b97..d55ce37 100644 --- a/commitpkg.in +++ b/commitpkg.in @@ -83,7 +83,7 @@ while getopts ':l:a:s:f' flag; do done shift $(( OPTIND - 1 )) -# check packages have the packager field set +# check packages for validity for _arch in "${arch[@]}"; do if [[ -n $commit_arch && ${_arch} != "$commit_arch" ]]; then continue @@ -95,6 +95,11 @@ for _arch in "${arch[@]}"; do if grep -q "packager = Unknown Packager" <(bsdtar -xOqf "$pkgfile" .PKGINFO); then die "PACKAGER was not set when building package" fi + hashsum=sha256sum + pkgbuild_hash=$(awk -v"hashsum=$hashsum" -F' = ' '$1 == "pkgbuild_"hashsum {print $2}' <(bsdtar -xOqf "$pkgfile" .BUILDINFO)) + if [[ "$pkgbuild_hash" != "$($hashsum PKGBUILD|cut -d' ' -f1)" ]]; then + die "PKGBUILD $hashsum mismatch: expected $pkgbuild_hash" + fi fi done done |