# - 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
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"
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" || \
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"
$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