Magellan Linux

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

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

revision 501 by niro, Sat Jun 30 15:38:50 2007 UTC revision 603 by niro, Mon Nov 5 19:36:36 2007 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.33 2007-06-30 15:38:50 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.34 2007-11-05 19:34:36 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

Legend:
Removed from v.501  
changed lines
  Added in v.603