hooks/do-fetch/00-distfiles: fix previous again.

This commit is contained in:
Juan RP 2014-03-07 11:22:51 +01:00
parent b9e30d45dc
commit ca2eeec0c0

View file

@ -20,6 +20,7 @@ verify_sha256_cksum() {
hook() { hook() {
local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version" local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
local errors=0
if [ ! -d "$srcdir" ]; then if [ ! -d "$srcdir" ]; then
mkdir -p -m775 "$srcdir" mkdir -p -m775 "$srcdir"
@ -56,7 +57,9 @@ hook() {
fi fi
verify_sha256_cksum $curfile $cksum $distfile verify_sha256_cksum $curfile $cksum $distfile
if [ $? -ne 0 ]; then
errors=$(($errors + 1)) errors=$(($errors + 1))
fi
unset cksum found unset cksum found
ckcount=0 ckcount=0
dfcount=$(($dfcount + 1)) dfcount=$(($dfcount + 1))
@ -96,14 +99,16 @@ hook() {
msg_error "$pkgver: cannot find checksum for $curfile.\n" msg_error "$pkgver: cannot find checksum for $curfile.\n"
fi fi
verify_sha256_cksum $curfile $cksum $distfile verify_sha256_cksum $curfile $cksum $distfile
if [ $? -ne 0 ]; then
errors=$(($errors + 1)) errors=$(($errors + 1))
fi
unset cksum found unset cksum found
ckcount=0 ckcount=0
fi fi
dfcount=$(($dfcount + 1)) dfcount=$(($dfcount + 1))
done done
if [ "$errors" -gt 0 ]; then if [ $errors -gt 0 ]; then
msg_error "$pkgver: couldn't verify distfiles, exiting...\n" msg_error "$pkgver: couldn't verify distfiles, exiting...\n"
fi fi
} }