summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-15 06:03:23 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-15 06:03:23 +0000
commit58f4cc3edcbcec3eeafd5aa87ac0b644d58cb82e (patch)
treec95bec52854136b2c27d651d8b9102f93e32627c
parent2342c61cd4af94e4f1db325f57c1d2af882229f1 (diff)
downloadportage-58f4cc3edcbcec3eeafd5aa87ac0b644d58cb82e.tar.gz
portage-58f4cc3edcbcec3eeafd5aa87ac0b644d58cb82e.tar.bz2
portage-58f4cc3edcbcec3eeafd5aa87ac0b644d58cb82e.zip
Bug #173284 - Do not traverse hidden directories such as .svn or .git when
search for protected files. (trunk r11927:11929) svn path=/main/branches/2.1.6/; revision=11930
-rwxr-xr-xbin/dispatch-conf5
-rwxr-xr-xbin/etc-update8
2 files changed, 8 insertions, 5 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 07131b55e..76f9b0c04 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -28,7 +28,7 @@ except ImportError:
from portage import dispatch_conf
from portage.process import find_binary
-FIND_EXTANT_CONFIGS = "find '%s' %s -iname '._cfg????_%s' ! -iname '.*~' ! -iname '.*.bak'"
+FIND_EXTANT_CONFIGS = "find '%s' %s -name '._cfg????_%s' ! -name '.*~' ! -iname '.*.bak' -print"
DIFF_CONTENTS = "diff -Nu '%s' '%s'"
DIFF_CVS_INTERP = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '# .Header:.*'"
DIFF_WSCOMMENTS = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '^[-+]#' | grep -v '^[-+][:space:]*$'"
@@ -93,11 +93,12 @@ class dispatch:
except OSError:
continue
basename = "*"
- find_opts = ""
+ find_opts = "-name '.*' -type d -prune -o"
if not stat.S_ISDIR(mymode):
path, basename = os.path.split(path)
find_opts = "-maxdepth 1"
+ print FIND_EXTANT_CONFIGS % (path, find_opts, basename)
confs += self.massage(os.popen(FIND_EXTANT_CONFIGS % (path, find_opts, basename)).readlines())
if self.options['use-rcs'] == 'yes':
diff --git a/bin/etc-update b/bin/etc-update
index cb58d13f1..4d29007f9 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -50,17 +50,19 @@ scan() {
for path in ${CONFIG_PROTECT} ; do
path="${ROOT}${path}"
- find_opts="-iname ._cfg????_*"
+ # Do not traverse hidden directories such as .svn or .git.
+ find_opts="-name .* -type d -prune -o -name ._cfg????_*"
if [ ! -d "${path}" ]; then
[ ! -f "${path}" ] && continue
my_basename="${path##*/}"
path="${path%/*}"
- find_opts="-maxdepth 1 -iname ._cfg????_${my_basename}"
+ find_opts="-maxdepth 1 -name ._cfg????_${my_basename}"
fi
ofile=""
# The below set -f turns off file name globbing in the ${find_opts} expansion.
- for file in $(set -f; find ${path}/ ${find_opts} ! -iname '.*~' ! -iname '.*.bak' |
+ for file in $(set -f ; find ${path}/ ${find_opts} \
+ ! -name '.*~' ! -iname '.*.bak' -print |
sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\2\%\3:" |
sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'); do