--- trunk/mage/usr/lib/mage/mage4.functions.sh 2010/04/22 12:22:39 972 +++ trunk/mage/usr/lib/mage/mage4.functions.sh 2010/06/28 18:46:57 1087 @@ -1179,10 +1179,7 @@ echo -e " fetching (${count_current}/${count_total}): ${pkg} ... " [[ ${VERBOSE} = off ]] && opt="--quiet" wget \ - --passive-ftp \ - --tries 3 \ - --continue \ - --progress bar \ + ${WGET_FETCH_OPTIONS} \ --directory-prefix=${PKGDIR} \ ${opt} ${mirr}/${PACKAGES_SERVER_PATH}/${pkg} if [[ $? = 0 ]] @@ -1232,8 +1229,13 @@ syncmage_tarball() { local latest_tarball + local latest_md5 local temp="$(mktemp -d)" local mirr mymirr + local opt + + # try to get the md5 marked as latest on the server + latest_md5="mage-latest.md5" # try to get the tarball marked as latest on the server latest_tarball="mage-latest.tar.bz2" @@ -1244,15 +1246,19 @@ mymirr="${mirr%/*}" echo -ne "${COLBLUE} --- ${COLDEFAULT}" - echo "fetching latest tarball from ${mymirr} ..." + echo "fetching latest md5 from ${mymirr} ..." + [[ ${VERBOSE} = off ]] && opt="--quiet" + wget \ + ${WGET_FETCH_OPTIONS} \ + --directory-prefix=${temp} \ + ${opt} ${mymirr}/rsync/tarballs/${latest_md5} + echo -ne "${COLBLUE} --- ${COLDEFAULT}" + echo "fetching latest tarball from ${mymirr} ..." wget \ - --passive-ftp \ - --tries 3 \ - --continue \ - --progress bar \ + ${WGET_FETCH_OPTIONS} \ --directory-prefix=${temp} \ - ${mymirr}/rsync/tarballs/${latest_tarball} + ${opt} ${mymirr}/rsync/tarballs/${latest_tarball} if [[ $? = 0 ]] then break @@ -1263,6 +1269,16 @@ if [[ -f ${temp}/${latest_tarball} ]] then + # check md5 + if [[ ! -f ${temp}/${latest_md5} ]] + then + die "md5 is missing ... aborting" + else + echo -ne "${COLBLUE} --- ${COLDEFAULT}" + echo -n "checking md5sum... " + ( cd ${temp}; md5sum --check ${latest_md5} ) || die "md5 for ${latest_tarball} failed" + fi + if [[ -d ${MAGEDIR} ]] then echo -ne "${COLBLUE} --- ${COLDEFAULT}"