Magellan Linux

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

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

revision 1648 by niro, Fri Jan 13 20:51:18 2012 UTC revision 1658 by niro, Sat Jan 14 00:00:53 2012 UTC
# Line 72  mchecksum() Line 72  mchecksum()
72   if [[ -d ${rundir} ]]   if [[ -d ${rundir} ]]
73   then   then
74   pushd ${rundir} &> /dev/null   pushd ${rundir} &> /dev/null
75   ${cmd} -c ${file} &> /dev/null   # be verbose here
76     ${cmd} -c ${file} #&> /dev/null
77   retval="$?"   retval="$?"
78   popd &> /dev/null   popd &> /dev/null
79   else   else
# Line 82  mchecksum() Line 83  mchecksum()
83   return "${retval}"   return "${retval}"
84  }  }
85    
86    mcheckemptydir()
87    {
88     local dir="$1"
89     local retval=1
90    
91     if [[ ! -d ${dir} ]]
92     then
93     echo "mcheckemptydir(): '${dir}' is not a directory!"
94     retval=3
95     else
96     shopt -s nullglob dotglob
97     files=( ${dir}/* )
98     (( ${#files[*]} )) || retval=0
99     shopt -u nullglob dotglob
100     fi
101    
102     return ${retval}
103    }
104    
105  unpack_packages()  unpack_packages()
106  {  {
107   local list="$@"   local list="$@"
# Line 1579  syncmage_tarball() Line 1599  syncmage_tarball()
1599   else   else
1600   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1601   echo -n "checking md5sum... "   echo -n "checking md5sum... "
1602   ( cd ${temp}; md5sum -c ${latest_md5} ) || die "md5 for ${latest_tarball} failed"   mchecksum --rundir "${temp}" --file "${latest_md5}" --method md5 || die "md5 for ${latest_tarball} failed"
1603   fi   fi
1604    
1605   if [[ -d ${MAGEDIR} ]]   if [[ -d ${MAGEDIR} ]]
1606   then   then
1607   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1608   echo "cleaning old mage-tree ${MAGEDIR}..."   echo "cleaning old mage-tree ${MAGEDIR}..."
1609   rm -rf ${MAGEDIR}   # honor mountpoints and empty dirs
1610     if mountpoint -q ${MAGEDIR}
1611     then
1612     if ! mcheckemptydir ${MAGEDIR}
1613     then
1614     find ${MAGEDIR} -mindepth 1 -maxdepth 1 | xarg --no-run-if-empty rm -r
1615     fi
1616     else
1617     rm -rf ${MAGEDIR}
1618     fi
1619   fi   fi
1620    
1621   if need_busybox_support tar   if need_busybox_support tar
# Line 1645  xtitleclean() Line 1674  xtitleclean()
1674  }  }
1675    
1676    
1677  # cuts full pathnames or versionized names down to basename  # unused?
1678  choppkgname()  #
1679  {  # # cuts full pathnames or versionized names down to basename
1680   #we want this only if full name was used  # choppkgname()
1681   if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ]  # {
1682   then  # #we want this only if full name was used
1683   #cuts ARCH and PBUILD  # if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ]
1684   #ARCH comes from ${MAGERC}  # then
1685   MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}-r*.::g")  # #cuts ARCH and PBUILD
1686    # #ARCH comes from ${MAGERC}
1687    # MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}$(print_distrotag)-r*.::g")
1688    #
1689    # #cuts version number
1690    # MAGENAME=$(basename ${MAGENAME%-*} .mage)
1691    # fi
1692    # }
1693    
  #cuts version number  
  MAGENAME=$(basename ${MAGENAME%-*} .mage)  
  fi  
 }  
1694    
1695  # get_categorie $PNAME, returns CATEGORIE  # get_categorie $PNAME, returns CATEGORIE
1696  # $1=pname  # $1=pname
# Line 2759  md5sum_packages() Line 2791  md5sum_packages()
2791   then   then
2792   echo -ne "${COLBLUE} *** ${COLDEFAULT}"   echo -ne "${COLBLUE} *** ${COLDEFAULT}"
2793   echo -ne "checking md5sum (${count_current}/${count_total}): "   echo -ne "checking md5sum (${count_current}/${count_total}): "
2794   ( cd ${PKGDIR}; md5sum -c ${md5file}) || die "md5 for ${pkgfile} failed"   mchecksum --rundir "${PKGDIR}" --file "${md5file}" --method md5 || die "md5 for ${pkgfile} failed"
2795   else   else
2796   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
2797   echo -e "!! no md5sum file found for ${pkgfile} :("   echo -e "!! no md5sum file found for ${pkgfile} :("
# Line 3297  known_mage_feature() Line 3329  known_mage_feature()
3329   libtool|!libtool) retval=0 ;;   libtool|!libtool) retval=0 ;;
3330   linuxsymlink|!linuxsymlink) retval=0 ;;   linuxsymlink|!linuxsymlink) retval=0 ;;
3331   pkgbuild|!pkgbuild) retval=0 ;;   pkgbuild|!pkgbuild) retval=0 ;;
3332     pkgdistrotag|!pkgdistrotag) retval=0 ;;
3333   purge|!purge) retval=0 ;;   purge|!purge) retval=0 ;;
3334   qalint|!qalint) retval=0 ;;   qalint|!qalint) retval=0 ;;
3335   regentree|!regentree) retval=0 ;;   regentree|!regentree) retval=0 ;;

Legend:
Removed from v.1648  
changed lines
  Added in v.1658