Magellan Linux

Diff of /branches/mage-next/src/mage4.functions.sh

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

revision 942 by niro, Fri Nov 20 21:53:33 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
# Line 2160  get_value_from_magefile() Line 2184  get_value_from_magefile()
2184   local SDEPEND   local SDEPEND
2185   local PROVIDE   local PROVIDE
2186   local PKGTYPE   local PKGTYPE
2187     local MAGE_TARGETS
2188     local SPLIT_PACKAGE_BASE
2189   local preinstall   local preinstall
2190   local postinstall   local postinstall
2191   local preremove   local preremove
# Line 2280  mage_install() Line 2306  mage_install()
2306   echo B:${pbuild}   echo B:${pbuild}
2307   fi   fi
2308    
2309   if [[ -z ${MAGE_TARGETS} ]]   if [[ -n ${MAGE_TARGETS} ]]
2310   then   then
2311   # basic svn compat   # basic svn compat
2312   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2313   then   then
2314   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2
2315   do   do
2316   smage2file="${i}"   smage2file="${i}"
2317   done   done
2318   else   else
2319   smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2   smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2
2320   fi   fi
2321    
2322     elif [[ -n ${SPLIT_PACKAGE_BASE} ]]
2323     then
2324     # basic svn compat
2325     if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2326     then
2327     for i in ${SMAGESCRIPTSDIR}/trunk/*/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2
2328     do
2329     smage2file="${i}"
2330     done
2331     else
2332     smage2file=${SMAGESCRIPTSDIR}/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2
2333     fi
2334    
2335   else   else
2336   # basic svn compat   # basic svn compat
2337   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2338   then   then
2339   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2
2340   do   do
2341   smage2file="${i}"   smage2file="${i}"
2342   done   done
2343   else   else
2344   smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2   smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2
2345   fi   fi
2346   fi   fi
2347    
2348   if [ -f "${smage2file}" ]   if [ -f "${smage2file}" ]
2349   then   then
2350   echo -e " ${COLBLUE}***${COLDEFAULT} building package from source ... "   echo -e " ${COLBLUE}***${COLDEFAULT} building package from source ... "

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