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 1087 by niro, Mon Jun 28 18:46:57 2010 UTC
# Line 1179  fetch_packages() Line 1179  fetch_packages()
1179   echo -e " fetching (${count_current}/${count_total}): ${pkg} ... "   echo -e " fetching (${count_current}/${count_total}): ${pkg} ... "
1180   [[ ${VERBOSE} = off ]] && opt="--quiet"   [[ ${VERBOSE} = off ]] && opt="--quiet"
1181   wget \   wget \
1182   --passive-ftp \   ${WGET_FETCH_OPTIONS} \
  --tries 3 \  
  --continue \  
  --progress bar \  
1183   --directory-prefix=${PKGDIR} \   --directory-prefix=${PKGDIR} \
1184   ${opt} ${mirr}/${PACKAGES_SERVER_PATH}/${pkg}   ${opt} ${mirr}/${PACKAGES_SERVER_PATH}/${pkg}
1185   if [[ $? = 0 ]]   if [[ $? = 0 ]]
# Line 1225  syncmage() Line 1222  syncmage()
1222   # clean up backup files (foo~)   # clean up backup files (foo~)
1223   find ${MAGEDIR} -name *~ -exec rm '{}' ';'   find ${MAGEDIR} -name *~ -exec rm '{}' ';'
1224    
1225   # check if an newer mage version is available   # check if a newer mage version is available
1226   is_newer_mage_version_available   is_newer_mage_version_available
1227  }  }
1228    
1229  syncmage_tarball()  syncmage_tarball()
1230  {  {
1231   local latest_tarball   local latest_tarball
1232     local latest_md5
1233   local temp="$(mktemp -d)"   local temp="$(mktemp -d)"
1234   local mirr mymirr   local mirr mymirr
1235     local opt
1236    
1237     # try to get the md5 marked as latest on the server
1238     latest_md5="mage-latest.md5"
1239    
1240   # try to get the tarball marked as latest on the server   # try to get the tarball marked as latest on the server
1241   latest_tarball="mage-latest.tar.bz2"   latest_tarball="mage-latest.tar.bz2"
# Line 1244  syncmage_tarball() Line 1246  syncmage_tarball()
1246   mymirr="${mirr%/*}"   mymirr="${mirr%/*}"
1247    
1248   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1249   echo "fetching latest tarball from ${mymirr} ..."   echo "fetching latest md5 from ${mymirr} ..."
1250     [[ ${VERBOSE} = off ]] && opt="--quiet"
1251     wget \
1252     ${WGET_FETCH_OPTIONS} \
1253     --directory-prefix=${temp} \
1254     ${opt} ${mymirr}/rsync/tarballs/${latest_md5}
1255    
1256     echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1257     echo "fetching latest tarball from ${mymirr} ..."
1258   wget \   wget \
1259   --passive-ftp \   ${WGET_FETCH_OPTIONS} \
  --tries 3 \  
  --continue \  
  --progress bar \  
1260   --directory-prefix=${temp} \   --directory-prefix=${temp} \
1261   ${mymirr}/rsync/tarballs/${latest_tarball}   ${opt} ${mymirr}/rsync/tarballs/${latest_tarball}
1262   if [[ $? = 0 ]]   if [[ $? = 0 ]]
1263   then   then
1264   break   break
# Line 1263  syncmage_tarball() Line 1269  syncmage_tarball()
1269    
1270   if [[ -f ${temp}/${latest_tarball} ]]   if [[ -f ${temp}/${latest_tarball} ]]
1271   then   then
1272     # check md5
1273     if [[ ! -f ${temp}/${latest_md5} ]]
1274     then
1275     die "md5 is missing ... aborting"
1276     else
1277     echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1278     echo -n "checking md5sum... "
1279     ( cd ${temp}; md5sum --check ${latest_md5} ) || die "md5 for ${latest_tarball} failed"
1280     fi
1281    
1282   if [[ -d ${MAGEDIR} ]]   if [[ -d ${MAGEDIR} ]]
1283   then   then
1284   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
# Line 1278  syncmage_tarball() Line 1294  syncmage_tarball()
1294   if [[ -d ${temp} ]]   if [[ -d ${temp} ]]
1295   then   then
1296   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1297   echo "clenaing temp-files ..."   echo "cleaning temp-files ..."
1298   rm -rf ${temp}   rm -rf ${temp}
1299   fi   fi
1300    
1301     # check if a newer mage version is available
1302     is_newer_mage_version_available
1303   else   else
1304   die "Could not fetch the latest tarball ... aborting"   die "Could not fetch the latest tarball ... aborting"
1305   fi   fi

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