Magellan Linux

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

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

revision 2271 by niro, Fri Oct 25 07:28:23 2013 UTC revision 2272 by niro, Fri Oct 25 07:31:51 2013 UTC
# Line 1472  fetch_packages() Line 1472  fetch_packages()
1472   local list="$@"   local list="$@"
1473   local pkgname   local pkgname
1474   local pkgfile   local pkgfile
1475     local pcat
1476     local pname
1477   local mirr   local mirr
1478   local magefile   local magefile
1479   local md5file   local md5file
# Line 1479  fetch_packages() Line 1481  fetch_packages()
1481   local count_current   local count_current
1482   local count_total   local count_total
1483   local wget_opts   local wget_opts
1484     local fetching
1485    
1486   [ -z "${MIRRORS}" ] && die "You have no mirrors defined. Please edit your ${MAGERC}."   [ -z "${MIRRORS}" ] && die "You have no mirrors defined. Please edit your ${MAGERC}."
1487    
# Line 1497  fetch_packages() Line 1500  fetch_packages()
1500   pkgfile="${pkgname}.${PKGSUFFIX}"   pkgfile="${pkgname}.${PKGSUFFIX}"
1501   pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"   pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"
1502    
1503     pcat=$(magename2pcat ${magefile})
1504     pname=$(magename2pname ${magefile})
1505     md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5"
1506    
1507   (( count_current++ ))   (( count_current++ ))
1508   xtitle "[ (${count_current}/${count_total}) Fetching ${pkgfile} ]"   xtitle "[ (${count_current}/${count_total}) Fetching ${pkgfile} ]"
1509    
# Line 1516  fetch_packages() Line 1523  fetch_packages()
1523   continue   continue
1524   fi   fi
1525    
1526   # abort if already exist   # check if FETCHING is required
1527   if [ -f ${PKGDIR}/${pkgfile} ]   if [ ! -f "${md5file}" ]
1528     then
1529     fetching=true
1530     else
1531     if mchecksum --rundir "${PKGDIR}" --file "${md5file}" --method md5 &> /dev/null
1532     then
1533     # md5's ok, no fetching required
1534     fetching=false
1535     else
1536     fetching=true
1537     fi
1538     fi
1539    
1540     if [[ ${fetching} = false ]]
1541   then   then
1542   echo -ne " ${COLBLUE}***${COLDEFAULT}"   echo -ne " ${COLBLUE}***${COLDEFAULT}"
1543   echo " fetch complete (${count_current}/${count_total}): ${pkgfile} ... "   echo " fetch complete (${count_current}/${count_total}): ${pkgfile} ... "
1544   continue   continue
1545     else
1546     echo -ne " ${COLBLUE}***${COLDEFAULT}"
1547     echo -e " fetching (${count_current}/${count_total}): ${pkgfile} ... "
1548     mdownload --uri "package://${pkgfile}" --dir "${PKGDIR}" || die "Could not download ${pkgfile}"
1549   fi   fi
1550    
1551   echo -ne " ${COLBLUE}***${COLDEFAULT}"   # sanity check, not really needed but to be sure
  echo -e " fetching (${count_current}/${count_total}): ${pkgfile} ... "  
  mdownload --uri "package://${pkgfile}" --dir "${PKGDIR}" || die "Could not download ${pkgfile}"  
1552   if [ ! -f ${PKGDIR}/${pkgfile} ]   if [ ! -f ${PKGDIR}/${pkgfile} ]
1553   then   then
1554   die "Package '${pkgfile}' after download not found in '${PKGDIR}'"   die "Package '${pkgfile}' after download not found in '${PKGDIR}'"

Legend:
Removed from v.2271  
changed lines
  Added in v.2272