]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - builder.sh
- message added
[packages/rpm-build-tools.git] / builder.sh
index ca19874a9a95b4ff7f7ce3a7a931c68722018497..1f25e9bce6407fed02e4b94b2cbd30ae37588f46 100644 (file)
@@ -13,8 +13,9 @@
 #      - builder -u fetches current version first
 #      - tries to get new version from distfiles without new md5
 #      - after fetching new version doesn't update md5
-#      - doesn't get sources for specs with %include  /usr/lib/rpm/macros.python
+#      - doesn't get sources for specs with %include /usr/lib/rpm/macros.python
 #        when there's no rpm-pythonprov (rpm's fault, but it's ugly anyway)
+#      - as above with %include /usr/lib/rpm/macros.perl and no rpm-perlprov
 
 VERSION="\
 Build package utility from PLD CVS repository
@@ -434,6 +435,7 @@ get_files()
            fi
        fi
        for i in $GET_FILES; do
+           FROM_DISTFILES=0
            if [ ! -f `nourl $i` ] || [ $ALWAYS_CVSUP = "yes" ]; then
                if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
                    echo "Warning: no URL given for $i"
@@ -446,10 +448,11 @@ get_files()
                    fi
                    target=$(nourl "$i")
                    url=$(distfiles_url "$i")
-                   if [ `echo $url | grep -E '^(\.|/)'` ] ; then
+                   if [ `echo $url | grep -E '^(\.|/)'` ]; then
                        ${GETLOCAL} $url $target
                    else
-                       if [ -z "$NOMIRRORS" ] ; then
+                       FROM_DISTFILES=1
+                       if [ -z "$NOMIRRORS" ]; then
                            url="`find_mirror "$url"`"
                        fi
                        ${GETURI} -O "$target" "$url" || \
@@ -478,7 +481,7 @@ get_files()
                fi
 
                if [ -z "$NOURLS" ] && [ ! -f "`nourl $i`" -o -n "$UPDATE" ] && [ `echo $i | grep -E 'ftp://|http://|https://'` ]; then
-                   if [ -z "$NOMIRRORS" ] ; then
+                   if [ -z "$NOMIRRORS" ]; then
                        im="`find_mirror "$i"`"
                    else
                        im="$i"
@@ -507,6 +510,21 @@ get_files()
                                $SPECS_DIR/$SPECFILE
            fi
 
+           if good_md5 "$i"; then
+               :
+           elif [ "$FROM_DISTFILES" = 1 ]; then
+               # wrong md5 from distfiles: remove the file and try again
+               # but only once ...
+               echo "MD5 sum mismatch. Trying full fetch."
+               FROM_DISTFILES=2
+               rm -f $target
+               ${GETURI} -O "$target" "$url" || \
+                   if [ `echo $url | grep -E 'ftp://'` ]; then
+                       ${GETURI2} -O "$target" "$url"
+                   fi
+               test -s "$target" || rm -f "$target"
+           fi
+
            if good_md5 "$i"; then
                :
            else
This page took 0.030734 seconds and 4 git commands to generate.