]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- handle additional-md5sums
authorMichal Moskal <michal@moskal.me>
Sun, 1 Jun 2003 14:11:35 +0000 (14:11 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- fix NoSource support

Changed files:
    builder.sh -> 1.164

builder.sh

index 551976927cd7df1a7eeb7bca25e333800240b980..8d32216e15ee2ad6a3410202f0f0d9f6cacb60f6 100644 (file)
@@ -351,7 +351,19 @@ src_md5 ()
     no=$(src_no "$1")
     [ -z "$no" ] && return
     cd $SPECS_DIR
-    grep -i "#[        ]*Source$no-md5[        ]*:" $SPECFILE | sed -e 's/.*://' | xargs
+    spec="$SPECFILE,$(head -1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')"
+    md5=$(grep -v '^#' additional-md5sums | \
+          grep -E "[   ]$(basename "$1")[      ]*[     ]${spec}([      ]|\$)" | \
+         sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \
+         grep -E '^[0-9a-f]{32}$')
+    if [ X"$md5" = X"" ] ; then
+      grep -i "#[      ]*Source$no-md5[        ]*:" $SPECFILE | sed -e 's/.*://' | xargs
+    else
+      if [ $(echo "$md5" | wc -l) != 1 ] ; then
+        echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2
+      fi
+      echo "$md5" | tail -1
+    fi
 }
 
 distfiles_url ()
@@ -455,7 +467,7 @@ get_files()
                    Exit_error err_no_source_in_repo $i;
                elif [ -n "$UPDATE5" ] && \
                     ( ( [ -n "$ADD5" ] && echo $i | grep -q -E 'ftp://|http://|https://' && \
-                        [ -z "$(grep -E -i '^NoSource[         ]*:[    ]*'$i'[^0-9]' $SPECS_DIR/$SPECFILE)" ] ) || \
+                        [ -z "$(grep -E -i '^NoSource[         ]*:[    ]*'$i'([        ]|$)' $SPECS_DIR/$SPECFILE)" ] ) || \
                       grep -q -i -E '^#[       ]*source'$(src_no $i)'-md5[     ]*:' $SPECS_DIR/$SPECFILE )
                then
                    echo "Updating source-$srcno md5."
This page took 0.031749 seconds and 4 git commands to generate.