makepkg: fix missing source file detection

Declaring the variable as local on the same line as the assignment
results in result of the assignment being returned rather than the
result of the function on the righthand side of the assignment.

Declaring the variable as local on a separate line means the result
of the function on the r.h.s. is returned and our error function
will be invoked if necessary  (although it is practically impossible
to ever trigger it...).

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2012-01-08 21:54:35 +10:00 committed by Dan McGee
parent 36413aa856
commit 2b38f4eab7
1 changed files with 2 additions and 1 deletions

View File

@ -624,7 +624,8 @@ generate_checksums() {
local netfile
for netfile in "${source[@]}"; do
local file="$(get_filepath "$netfile")" || missing_source_file "$netfile"
local file
file="$(get_filepath "$netfile")" || missing_source_file "$netfile"
local sum="$(openssl dgst -${integ} "$file")"
sum=${sum##* }
(( ct )) && echo -n "$indent"