Magellan Linux

Diff of /trunk/mage/usr/lib/mage/mage4.functions.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 943 by niro, Fri Nov 20 22:39:11 2009 UTC revision 1084 by niro, Mon Jun 28 18:08:15 2010 UTC
# Line 1225  syncmage() Line 1225  syncmage()
1225   # clean up backup files (foo~)   # clean up backup files (foo~)
1226   find ${MAGEDIR} -name *~ -exec rm '{}' ';'   find ${MAGEDIR} -name *~ -exec rm '{}' ';'
1227    
1228   # check if an newer mage version is available   # check if a newer mage version is available
1229   is_newer_mage_version_available   is_newer_mage_version_available
1230  }  }
1231    
1232  syncmage_tarball()  syncmage_tarball()
1233  {  {
1234   local latest_tarball   local latest_tarball
1235     local latest_md5
1236   local temp="$(mktemp -d)"   local temp="$(mktemp -d)"
1237   local mirr mymirr   local mirr mymirr
1238    
1239     # try to get the md5 marked as latest on the server
1240     latest_md5="mage-latest.md5"
1241    
1242   # try to get the tarball marked as latest on the server   # try to get the tarball marked as latest on the server
1243   latest_tarball="mage-latest.tar.bz2"   latest_tarball="mage-latest.tar.bz2"
1244    
# Line 1244  syncmage_tarball() Line 1248  syncmage_tarball()
1248   mymirr="${mirr%/*}"   mymirr="${mirr%/*}"
1249    
1250   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1251   echo "fetching latest tarball from ${mymirr} ..."   echo "fetching latest md5 from ${mymirr} ..."
1252     wget \
1253     --passive-ftp \
1254     --tries 3 \
1255     --continue \
1256     --progress bar \
1257     --directory-prefix=${temp} \
1258     ${mymirr}/rsync/tarballs/${latest_md5}
1259    
1260     echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1261     echo "fetching latest tarball from ${mymirr} ..."
1262   wget \   wget \
1263   --passive-ftp \   --passive-ftp \
1264   --tries 3 \   --tries 3 \
# Line 1263  syncmage_tarball() Line 1276  syncmage_tarball()
1276    
1277   if [[ -f ${temp}/${latest_tarball} ]]   if [[ -f ${temp}/${latest_tarball} ]]
1278   then   then
1279     # check md5
1280     if [[ ! -f ${temp}/${latest_md5} ]]
1281     then
1282     die "md5 is missing ... aborting"
1283     else
1284     ( cd ${temp}; md5sum --check ${lastest_md5} ) || die "md5 for ${lastest_tarball} failed"
1285     fi
1286    
1287   if [[ -d ${MAGEDIR} ]]   if [[ -d ${MAGEDIR} ]]
1288   then   then
1289   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
# Line 1278  syncmage_tarball() Line 1299  syncmage_tarball()
1299   if [[ -d ${temp} ]]   if [[ -d ${temp} ]]
1300   then   then
1301   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1302   echo "clenaing temp-files ..."   echo "cleaning temp-files ..."
1303   rm -rf ${temp}   rm -rf ${temp}
1304   fi   fi
1305    
1306     # check if a newer mage version is available
1307     is_newer_mage_version_available
1308   else   else
1309   die "Could not fetch the latest tarball ... aborting"   die "Could not fetch the latest tarball ... aborting"
1310   fi   fi

Legend:
Removed from v.943  
changed lines
  Added in v.1084