Magellan Linux

Diff of /trunk/mage/usr/lib/mage/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 1083 by niro, Mon Jun 28 18:07:29 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 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} ..."   echo "fetching latest tarball from ${mymirr} ..."
1262    
1263   wget \   wget \
# Line 1263  syncmage_tarball() Line 1277  syncmage_tarball()
1277    
1278   if [[ -f ${temp}/${latest_tarball} ]]   if [[ -f ${temp}/${latest_tarball} ]]
1279   then   then
1280     # check md5
1281     if [[ ! -f ${temp}/${latest_md5} ]]
1282     then
1283     die "md5 is missing ... aborting"
1284     else
1285     ( cd ${temp}; md5sum --check ${lastest_md5} ) || die "md5 for ${lastest_tarball} failed"
1286     fi
1287    
1288   if [[ -d ${MAGEDIR} ]]   if [[ -d ${MAGEDIR} ]]
1289   then   then
1290   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
# Line 1278  syncmage_tarball() Line 1300  syncmage_tarball()
1300   if [[ -d ${temp} ]]   if [[ -d ${temp} ]]
1301   then   then
1302   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1303   echo "clenaing temp-files ..."   echo "cleaning temp-files ..."
1304   rm -rf ${temp}   rm -rf ${temp}
1305   fi   fi
1306    
1307     # check if a newer mage version is available
1308     is_newer_mage_version_available
1309   else   else
1310   die "Could not fetch the latest tarball ... aborting"   die "Could not fetch the latest tarball ... aborting"
1311   fi   fi
# Line 2160  get_value_from_magefile() Line 2185  get_value_from_magefile()
2185   local SDEPEND   local SDEPEND
2186   local PROVIDE   local PROVIDE
2187   local PKGTYPE   local PKGTYPE
2188     local MAGE_TARGETS
2189     local SPLIT_PACKAGE_BASE
2190   local preinstall   local preinstall
2191   local postinstall   local postinstall
2192   local preremove   local preremove
# Line 2280  mage_install() Line 2307  mage_install()
2307   echo B:${pbuild}   echo B:${pbuild}
2308   fi   fi
2309    
2310   if [[ -z ${MAGE_TARGETS} ]]   if [[ -n ${MAGE_TARGETS} ]]
2311   then   then
2312   # basic svn compat   # basic svn compat
2313   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2314   then   then
2315   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2
2316   do   do
2317   smage2file="${i}"   smage2file="${i}"
2318   done   done
2319   else   else
2320   smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2   smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2
2321   fi   fi
2322    
2323     elif [[ -n ${SPLIT_PACKAGE_BASE} ]]
2324     then
2325     # basic svn compat
2326     if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2327     then
2328     for i in ${SMAGESCRIPTSDIR}/trunk/*/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2
2329     do
2330     smage2file="${i}"
2331     done
2332     else
2333     smage2file=${SMAGESCRIPTSDIR}/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2
2334     fi
2335    
2336   else   else
2337   # basic svn compat   # basic svn compat
2338   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2339   then   then
2340   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2
2341   do   do
2342   smage2file="${i}"   smage2file="${i}"
2343   done   done
2344   else   else
2345   smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2   smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2
2346   fi   fi
2347   fi   fi
2348    
2349   if [ -f "${smage2file}" ]   if [ -f "${smage2file}" ]
2350   then   then
2351   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.1083