summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2006-07-19 11:41:41 +0000
committerMarius Mauch <genone@gentoo.org>2006-07-19 11:41:41 +0000
commitb68c791bdbb3e8c854e0895369de0615438de59f (patch)
tree8160750d782c71d074b431f13339b5f7f535d2b6
parente48d4595bb2e9eabbff7cec90bbec3fc3ed419f0 (diff)
downloadportage-b68c791bdbb3e8c854e0895369de0615438de59f.tar.gz
portage-b68c791bdbb3e8c854e0895369de0615438de59f.tar.bz2
portage-b68c791bdbb3e8c854e0895369de0615438de59f.zip
add support to prevent auto-processing for user-special files that match a pattern in /etc/etc-update.special
svn path=/main/trunk/; revision=3936
-rwxr-xr-xbin/etc-update18
1 files changed, 16 insertions, 2 deletions
diff --git a/bin/etc-update b/bin/etc-update
index d0b7b7b18..340be9eb7 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -177,6 +177,20 @@ configuration file is followed by a list of possible replacement files."
done
}
+function user_special() {
+ if [ -r /etc/etc-update.special ]; then
+ if [ -z "$1" ]; then
+ echo "ERROR: user_special() called without arguments"
+ return 1
+ fi
+ while read pat; do
+ echo ${1} | grep "${pat}" > /dev/null && return 0
+ done < /etc/etc-update.special
+ else
+ return 1
+ fi
+}
+
function do_file() {
echo
local -i my_input
@@ -259,9 +273,9 @@ function do_cfg() {
local -i my_input=0
until (( ${my_input} == -1 )) || [ ! -f ${file} ]; do
- if [ "${OVERWRITE_ALL}" == "yes" ]; then
+ if [[ "${OVERWRITE_ALL}" == "yes" && ! user_special ${ofile} ]]; then
my_input=1
- elif [ "${DELETE_ALL}" == "yes" ]; then
+ elif [[ "${DELETE_ALL}" == "yes" && ! user_special ${ofile} ]]; then
my_input=2
else
showdiffcmd=$(echo "${diff_command}" |