From: Michal Moskal Date: Tue, 27 May 2003 17:49:50 +0000 (+0000) Subject: - say bye bye if there is md5 sum mismatch X-Git-Tag: auto/ac/rpm-4_3-0_20030610_22~39 X-Git-Url: http://git.pld-linux.org/?a=commitdiff_plain;h=d99ac371bb572e97634498098b1c32a951bb7314;p=packages%2Frpm-build-tools.git - say bye bye if there is md5 sum mismatch Changed files: builder.sh -> 1.159 --- diff --git a/builder.sh b/builder.sh index 10a4918..5b02135 100644 --- a/builder.sh +++ b/builder.sh @@ -358,6 +358,13 @@ distfiles_url () echo "$DISTFILES_SERVER/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")" } +good_md5 () +{ + md5=$(src_md5 "$1") + [ "$md5" = "" ] || \ + [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ] +} + get_files() { GET_FILES="$@" @@ -396,7 +403,7 @@ get_files() fi if [ -n "$(src_md5 "$i")" ] && [ -z "$NODIST" ]; then - if [ "$(src_md5 "$i")" = "$(md5sum $(nourl "$i") 2> /dev/null | sed -e 's/ .*//')" ]; then + if good_md5 "$i"; then echo "$(nourl "$i") having proper md5sum already exists" continue fi @@ -452,6 +459,14 @@ get_files() print unless /^\s*#\s*Source'$srcno'-md5\s*:/i' \ $SPECS_DIR/$SPECFILE fi + + if good_md5 "$i"; then + : + else + echo "MD5 sum mismatch. Use -U to refetch sources," + echo "or -5 to update md5 sums, if you're sure files are correct." + Exit_error err_no_source_in_repo $i + fi fi done