]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- say bye bye if there is md5 sum mismatch
authorMichal Moskal <michal@moskal.me>
Tue, 27 May 2003 17:49:50 +0000 (17:49 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    builder.sh -> 1.159

builder.sh

index 10a4918eb4ddc859d83b92e75bc2e50bb3fd0ba6..5b02135652c4d6e183e33bfdd5d07a7626e8fc0e 100644 (file)
@@ -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
 
This page took 0.038136 seconds and 4 git commands to generate.