--- 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:07:29 1083 @@ -1232,9 +1232,13 @@ syncmage_tarball() { local latest_tarball + local latest_md5 local temp="$(mktemp -d)" local mirr mymirr + # 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,6 +1248,16 @@ mymirr="${mirr%/*}" echo -ne "${COLBLUE} --- ${COLDEFAULT}" + echo "fetching latest md5 from ${mymirr} ..." + wget \ + --passive-ftp \ + --tries 3 \ + --continue \ + --progress bar \ + --directory-prefix=${temp} \ + ${mymirr}/rsync/tarballs/${latest_md5} + + echo -ne "${COLBLUE} --- ${COLDEFAULT}" echo "fetching latest tarball from ${mymirr} ..." wget \ @@ -1263,6 +1277,14 @@ if [[ -f ${temp}/${latest_tarball} ]] then + # check md5 + if [[ ! -f ${temp}/${latest_md5} ]] + then + die "md5 is missing ... aborting" + else + ( cd ${temp}; md5sum --check ${lastest_md5} ) || die "md5 for ${lastest_tarball} failed" + fi + if [[ -d ${MAGEDIR} ]] then echo -ne "${COLBLUE} --- ${COLDEFAULT}"