Magellan Linux

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

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

revision 941 by niro, Tue Aug 4 19:52:16 2009 UTC revision 942 by niro, Fri Nov 20 21:53:33 2009 UTC
# Line 198  install_files() Line 198  install_files()
198   is_config_protected "${pathto}"   is_config_protected "${pathto}"
199   retval="$?"   retval="$?"
200    
201   # 0 - not protected        #   # 0 - not protected         #
202   # 1 - error                #   # 1 - error                 #
203   # 2 - protected            #   # 2 - protected             #
204   # 3 - protected but masked #   # 3 - protected but masked  #
205     # 4 - protected but ignored #
206    
207   case ${retval} in   case ${retval} in
208   # file is not protected - (over)write it   # file is not protected - (over)write it
# Line 252  install_files() Line 253  install_files()
253   (( MAGE_PROTECT_COUNTER++ ))   (( MAGE_PROTECT_COUNTER++ ))
254   export MAGE_PROTECT_COUNTER   export MAGE_PROTECT_COUNTER
255   ;;   ;;
256    
257     # file is protected but ignored, delete the update/do nothing
258     4)
259     if [[ ${VERBOSE} = on ]]
260     then
261     echo -en "${COLRED}"
262     echo -n "! ignr "
263     echo -en "${COLDEFAULT}"
264     echo " === FILE: ${MROOT}${pathto}"
265     fi
266     # simply do nothing here
267     ;;
268   esac   esac
269   done < ${BUILDDIR}/${pkgname}/.files   done < ${BUILDDIR}/${pkgname}/.files
270    
# Line 809  remove_files() Line 822  remove_files()
822   is_config_protected "${pathto}"   is_config_protected "${pathto}"
823   retval="$?"   retval="$?"
824    
825   # 0 - not protected        #   # 0 - not protected         #
826   # 1 - error                #   # 1 - error                 #
827   # 2 - protected            #   # 2 - protected             #
828   # 3 - protected but masked #   # 3 - protected but masked  #
829     # 4 - protected but ignored #
830    
831   case ${retval} in   case ${retval} in
832   # file is not protected - delete it   # file is not protected - delete it
# Line 831  remove_files() Line 845  remove_files()
845   echo " === FILE: ${MROOT}${pathto}"   echo " === FILE: ${MROOT}${pathto}"
846   fi   fi
847   ;;   ;;
848    
849     # file is protected but ignored, delete the update/do nothing
850     4)
851     if [[ ${VERBOSE} = on ]]
852     then
853     echo -en "${COLRED}"
854     echo -n "! ignr "
855     echo -en "${COLDEFAULT}"
856     echo " === FILE: ${MROOT}${pathto}"
857     fi
858     # simply do nothing here
859     ;;
860   esac   esac
861   ;;   ;;
862   1)   1)
# Line 1422  get_highest_magefile() Line 1448  get_highest_magefile()
1448  #        1 - error                                #  #        1 - error                                #
1449  #        2 - protected                            #  #        2 - protected                            #
1450  #        3 - protected but masked                 #  #        3 - protected but masked                 #
1451    #        4 - protected but ignored                #
1452  #                                                 #  #                                                 #
1453  ###################################################  ###################################################
1454  is_config_protected()  is_config_protected()
# Line 1430  is_config_protected() Line 1457  is_config_protected()
1457   local TEST   local TEST
1458   local PROTECTED   local PROTECTED
1459   local IFS   local IFS
1460     local i
1461     local x
1462    
1463   EXPFILE="${MROOT}$1"   EXPFILE="${MROOT}$1"
1464    
# Line 1439  is_config_protected() Line 1468  is_config_protected()
1468   # to be safe; it may be '§'   # to be safe; it may be '§'
1469   IFS=' '   IFS=' '
1470    
1471   # check ob in config protect   # check if config protected
1472   for i in ${CONFIG_PROTECT}   for i in ${CONFIG_PROTECT}
1473   do   do
1474   # ersetzen von $i nur wenn am anfang der variable   # only replace $i in the beginning of the variable
1475   TEST="${EXPFILE/#${MROOT}${i}/Protected}"   TEST="${EXPFILE/#${MROOT}${i}/Protected}"
1476   if [[ ${TEST} != ${EXPFILE} ]]   if [[ ${TEST} != ${EXPFILE} ]]
1477   then   then
1478   # setzen das es protected ist   # file is config proteced
1479   PROTECTED=TRUE   PROTECTED=TRUE
1480    
1481   # check ob nicht doch maskiert   # check if not masked
1482   for x in ${CONFIG_PROTECT_MASK}   for x in ${CONFIG_PROTECT_MASK}
1483   do   do
1484   TEST="${EXPFILE/#${MROOT}${x}/Protect_Masked}"   TEST="${EXPFILE/#${MROOT}${x}/Protect_Masked}"
# Line 1458  is_config_protected() Line 1487  is_config_protected()
1487   PROTECTED=MASKED   PROTECTED=MASKED
1488   fi   fi
1489   done   done
1490    
1491     # check if not ignored
1492     for x in ${CONFIG_PROTECT_IGNORE}
1493     do
1494     TEST="${EXPFILE/#${MROOT}${x}/Protect_Ignored}"
1495     if [[ ${TEST} != ${EXPFILE} ]]
1496     then
1497     PROTECTED=IGNORED
1498     fi
1499     done
1500   fi   fi
1501   done   done
1502    
# Line 1472  is_config_protected() Line 1511  is_config_protected()
1511   #echo "I'm protected, but masked - delete me"   #echo "I'm protected, but masked - delete me"
1512   return 3   return 3
1513   ;;   ;;
1514     IGNORED)
1515     #echo "I'm protected, but ignored - keep me, del update"
1516     return 4
1517     ;;
1518   *)   *)
1519   #echo "delete me"   #echo "delete me"
1520   return 0   return 0

Legend:
Removed from v.941  
changed lines
  Added in v.942