--- trunk/mage/usr/lib/mage/mage4.functions.sh 2009/11/20 19:41:27 941 +++ trunk/mage/usr/lib/mage/mage4.functions.sh 2009/11/20 21:53:33 942 @@ -198,10 +198,11 @@ is_config_protected "${pathto}" retval="$?" - # 0 - not protected # - # 1 - error # - # 2 - protected # - # 3 - protected but masked # + # 0 - not protected # + # 1 - error # + # 2 - protected # + # 3 - protected but masked # + # 4 - protected but ignored # case ${retval} in # file is not protected - (over)write it @@ -252,6 +253,18 @@ (( MAGE_PROTECT_COUNTER++ )) export MAGE_PROTECT_COUNTER ;; + + # file is protected but ignored, delete the update/do nothing + 4) + if [[ ${VERBOSE} = on ]] + then + echo -en "${COLRED}" + echo -n "! ignr " + echo -en "${COLDEFAULT}" + echo " === FILE: ${MROOT}${pathto}" + fi + # simply do nothing here + ;; esac done < ${BUILDDIR}/${pkgname}/.files @@ -809,10 +822,11 @@ is_config_protected "${pathto}" retval="$?" - # 0 - not protected # - # 1 - error # - # 2 - protected # - # 3 - protected but masked # + # 0 - not protected # + # 1 - error # + # 2 - protected # + # 3 - protected but masked # + # 4 - protected but ignored # case ${retval} in # file is not protected - delete it @@ -831,6 +845,18 @@ echo " === FILE: ${MROOT}${pathto}" fi ;; + + # file is protected but ignored, delete the update/do nothing + 4) + if [[ ${VERBOSE} = on ]] + then + echo -en "${COLRED}" + echo -n "! ignr " + echo -en "${COLDEFAULT}" + echo " === FILE: ${MROOT}${pathto}" + fi + # simply do nothing here + ;; esac ;; 1) @@ -1422,6 +1448,7 @@ # 1 - error # # 2 - protected # # 3 - protected but masked # +# 4 - protected but ignored # # # ################################################### is_config_protected() @@ -1430,6 +1457,8 @@ local TEST local PROTECTED local IFS + local i + local x EXPFILE="${MROOT}$1" @@ -1439,17 +1468,17 @@ # to be safe; it may be '§' IFS=' ' - # check ob in config protect + # check if config protected for i in ${CONFIG_PROTECT} do - # ersetzen von $i nur wenn am anfang der variable + # only replace $i in the beginning of the variable TEST="${EXPFILE/#${MROOT}${i}/Protected}" if [[ ${TEST} != ${EXPFILE} ]] then - # setzen das es protected ist + # file is config proteced PROTECTED=TRUE - # check ob nicht doch maskiert + # check if not masked for x in ${CONFIG_PROTECT_MASK} do TEST="${EXPFILE/#${MROOT}${x}/Protect_Masked}" @@ -1458,6 +1487,16 @@ PROTECTED=MASKED fi done + + # check if not ignored + for x in ${CONFIG_PROTECT_IGNORE} + do + TEST="${EXPFILE/#${MROOT}${x}/Protect_Ignored}" + if [[ ${TEST} != ${EXPFILE} ]] + then + PROTECTED=IGNORED + fi + done fi done @@ -1472,6 +1511,10 @@ #echo "I'm protected, but masked - delete me" return 3 ;; + IGNORED) + #echo "I'm protected, but ignored - keep me, del update" + return 4 + ;; *) #echo "delete me" return 0