Magellan Linux

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

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

revision 499 by niro, Sat Jun 30 15:31:46 2007 UTC revision 675 by niro, Sun Feb 10 12:26:09 2008 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # Magellan Linux Installer Functions (mage.functions.sh)  # Magellan Linux Installer Functions (mage.functions.sh)
3  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.32 2007-06-30 15:31:46 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.35 2008-02-10 12:26:09 niro Exp $
4    
5  mage_setup()  mage_setup()
6  {  {
# Line 1430  is_config_protected() Line 1430  is_config_protected()
1430  ###################################################  ###################################################
1431  count_protected_files()  count_protected_files()
1432  {  {
1433   ${MLIBDIR}/writeprotected "$1"   local file="$1"
1434     local dirname="${file%/*}"
1435     local filename="${file##*/}"
1436     local count
1437     local output
1438     local i
1439    
1440     declare -i count=0
1441    
1442     # check if there are already protected files
1443     for oldpretected in $(find ${dirname} -iname "._cfg????_${filename}" |
1444     sed -e "s:\(^.*/\)\(._cfg*_\)\(/.*$\):\1\2\3\%\2\%\3:" |
1445     sort -t'%' -k3 -k2 | cut -f1 -d'%')
1446     do
1447     count=$(echo ${oldpretected} | cut -d_ -f2 | sed -e "s:cfg::")
1448     done
1449     (( count ++ ))
1450    
1451     # fill output up with zeros
1452     for (( i=${#count}; i < 4; i++ )); do output="${output}0"; done
1453     output="${output}${count}"
1454    
1455     echo "${output}"
1456  }  }
1457    
1458  # call with  # call with
# Line 2155  mage_install() Line 2177  mage_install()
2177   echo B:${pbuild}   echo B:${pbuild}
2178   fi   fi
2179    
2180   smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2   if [[ -z ${MAGE_TARGETS} ]]
2181     then
2182     smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2
2183     else
2184     smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2
2185     fi
2186   if [ -f "${smage2file}" ]   if [ -f "${smage2file}" ]
2187   then   then
2188   echo -e " ${COLBLUE}***${COLDEFAULT} building package from source ... "   echo -e " ${COLBLUE}***${COLDEFAULT} building package from source ... "
# Line 2340  uninstall_packages() Line 2367  uninstall_packages()
2367   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
2368   echo -ne "${COLBOLD}${can_pcat}/${can_pname}:${COLDEFAULT}"   echo -ne "${COLBOLD}${can_pcat}/${can_pname}:${COLDEFAULT}"
2369   echo -e "${COLRED} ${can_ver_list} ${COLDEFAULT}"   echo -e "${COLRED} ${can_ver_list} ${COLDEFAULT}"
2370   echo        [04] app-emulation/virtualbox-1.4.0-r3   echo
2371   if [ ${MAGE_UNINSTALL_TIMEOUT} -gt 0 ]   if [ ${MAGE_UNINSTALL_TIMEOUT} -gt 0 ]
2372   then   then
2373   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
# Line 2406  mage_uninstall() Line 2433  mage_uninstall()
2433   for i in $*   for i in $*
2434   do   do
2435   case $1 in   case $1 in
2436   --pcat|-c) shift; pcat="$1" ;;        [04] app-emulation/virtualbox-1.4.0-r3   --pcat|-c) shift; pcat="$1" ;;
2437   --pname|-n) shift; pname="$1" ;;   --pname|-n) shift; pname="$1" ;;
2438   --pver|-v) shift; pver="$1" ;;   --pver|-v) shift; pver="$1" ;;
2439   --pbuild|-b) shift; pbuild="$1" ;;        [04] app-emulation/virtualbox-1.4.0-r3   --pbuild|-b) shift; pbuild="$1" ;;
2440   esac   esac
2441   shift   shift
2442   done        [04] app-emulation/virtualbox-1.4.0-r3   done
2443    
2444   # sanity checks; abort if not given   # sanity checks; abort if not given
2445   [ -z "${pcat}" ] && die "mage_uninstall() \$pcat not given."        [04] app-emulation/virtualbox-1.4.0-r3   [ -z "${pcat}" ] && die "mage_uninstall() \$pcat not given."
2446   [ -z "${pname}" ] && die "mage_uninstall() \$pname not given."   [ -z "${pname}" ] && die "mage_uninstall() \$pname not given."
2447   [ -z "${pver}" ] && die "mage_uninstall() \$pver not given."   [ -z "${pver}" ] && die "mage_uninstall() \$pver not given."
2448   [ -z "${pbuild}" ] && die "mage_uninstall() \$pbuild not given."        [04] app-emulation/virtualbox-1.4.0-r3   [ -z "${pbuild}" ] && die "mage_uninstall() \$pbuild not given."
2449    
2450   # check needed global vars   # check needed global vars
2451   [ -z "${MAGEDIR}" ] && die "mage_uninstall() \$MAGEDIR not set."   [ -z "${MAGEDIR}" ] && die "mage_uninstall() \$MAGEDIR not set."

Legend:
Removed from v.499  
changed lines
  Added in v.675