--- trunk/mage/usr/lib/mage/mage4.functions.sh 2005/10/21 14:50:13 273 +++ trunk/mage/usr/lib/mage/mage4.functions.sh 2005/10/21 16:01:40 280 @@ -1,6 +1,6 @@ #!/bin/bash # Magellan Linux Installer Functions (mage.functions.sh) -# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.8 2005-10-21 14:50:13 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.9 2005-10-21 16:01:40 niro Exp $ mage_setup() { @@ -765,10 +765,35 @@ # 1=keep me # case ${retval} in 0) - [[ ${VERBOSE} = on ]] && echo -e "\t<<< FILE: ${MROOT}${pathto}" - rm "${MROOT}${pathto}" + # check if the file is config_protected + # ${MROOT} will automatically added if set !! + is_config_protected "${pathto}" + retval="$?" + + # 0 - not protected # + # 1 - error # + # 2 - protected # + # 3 - protected but masked # + + case ${retval} in + # file is not protected - delete it + 0|3) + [[ ${VERBOSE} = on ]] && echo -e "\t<<< FILE: ${MROOT}${pathto}" + rm "${MROOT}${pathto}" + ;; + + # file is protected, do not delete + 2) + if [[ ${VERBOSE} = on ]] + then + echo -en "${COLRED}" + echo -n "! prot " + echo -en "${COLDEFAULT}" + echo " === FILE: ${MROOT}${pathto}" + fi + ;; + esac ;; - 1) [[ ${VERBOSE} = on ]] && \ echo -e "${COLRED}! mtime${COLDEFAULT} === FILE: ${MROOT}${pathto}"