On Mon, Apr 6, 2009 at 11:15 PM, Loui Chang <louipc.ist@gmail.com> wrote:
The index in the for loop wasn't being incremented, so if the first file wasn't found, the second file would be compared to the first checksum, rather than the second.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This seems fine, but what the hell is going on around line 580? Is it just me that thinks a double check on "$file" is odd? if [ ! -f "$file" ] ; then if [ ! -f "$file" ] ; then echo "$(gettext "NOT FOUND")" >&2 errors=1 found=0 else file="$SRCDEST/$file" fi fi Originally when this came in it looked like the following (commit 142225fd): + + if [ ! -f "$file" ] ; then + if [ ! -f "$SRCDEST/$file" ] ; then + error "$(gettext "Unable to find source file %s to generate checksum.")" "$file" + plain "$(gettext "Aborting...")" + exit 1 + else + file=$SRCDEST/$file + fi + fi + git-blame is lying to me here and I can't find when this was changed. Anyone else know what the heck happened here?
--- scripts/makepkg.sh.in | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 349d0e0..9ff70f6 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -573,6 +573,7 @@ check_checksums() { local idx=0 local file for file in "${source[@]}"; do + local found=1 file="$(get_filename "$file")" echo -n " $file ... " >&2
@@ -580,19 +581,21 @@ check_checksums() { if [ ! -f "$file" ] ; then echo "$(gettext "NOT FOUND")" >&2 errors=1 - continue + found=0 else file="$SRCDEST/$file" fi fi
- local expectedsum="$(echo ${integrity_sums[$idx]} | tr '[A-F]' '[a-f]')" - local realsum="$(openssl dgst -${integ} "$file" | awk '{print $NF}')" - if [ "$expectedsum" = "$realsum" ]; then - echo "$(gettext "Passed")" >&2 - else - echo "$(gettext "FAILED")" >&2 - errors=1 + if [ $found -gt 0 ] ; then + local expectedsum="$(echo ${integrity_sums[$idx]} | tr '[A-F]' '[a-f]')" + local realsum="$(openssl dgst -${integ} "$file" | awk '{print $NF}')" + if [ "$expectedsum" = "$realsum" ]; then + echo "$(gettext "Passed")" >&2 + else + echo "$(gettext "FAILED")" >&2 + errors=1 + fi fi
idx=$((idx + 1)) -- 1.6.2.2
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://www.archlinux.org/mailman/listinfo/pacman-dev