summaryrefslogtreecommitdiffstats
path: root/bin/etc-update
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-09-16 00:45:25 +0000
committerZac Medico <zmedico@gentoo.org>2006-09-16 00:45:25 +0000
commit48415fe13b8300587fa0d725fac05237f6965957 (patch)
tree114589b7d738abb411fe54ad40aceacac92f9182 /bin/etc-update
parent689d099f5ed6b41e3bd517c1b201363ec78b25ad (diff)
downloadportage-48415fe13b8300587fa0d725fac05237f6965957.tar.gz
portage-48415fe13b8300587fa0d725fac05237f6965957.tar.bz2
portage-48415fe13b8300587fa0d725fac05237f6965957.zip
For bug #14321, make etc-update scan for individual files listed in CONFIG_PROTECT.
svn path=/main/trunk/; revision=4460
Diffstat (limited to 'bin/etc-update')
-rwxr-xr-xbin/etc-update12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/etc-update b/bin/etc-update
index a02088545..09acb7134 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -33,6 +33,8 @@ function scan() {
mkdir ${TMP}/files || die "Failed mkdir command!" 1
count=0
input=0
+ local find_opts
+ local my_basename
# Sanity check to make sure diff exists and works
if ! diff -v &>/dev/null ; then
@@ -41,10 +43,16 @@ function scan() {
fi
for path in ${CONFIG_PROTECT} ; do
- [ ! -d ${path} ] && continue
+ find_opts="-iname ._cfg????_*"
+ if [ ! -d "${path}" ]; then
+ [ ! -f "${path}" ] && continue
+ my_basename="${path##*/}"
+ path="${path%/*}"
+ find_opts="-maxdepth 1 -iname ._cfg????_${my_basename}"
+ fi
ofile=""
- for file in $(find ${path}/ -iname '._cfg????_*' ! -name '.*~' ! -name '.*.bak' |
+ for file in $(find ${path}/ ${find_opts} ! -name '.*~' ! -name '.*.bak' |
sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\2\%\3:" |
sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'); do
rpath=$(echo "${file/\/\///}" | sed -e "s:/[^/]*$::")