diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-11-15 05:59:45 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-11-15 05:59:45 +0000 |
commit | 881a74506898c4fcfae0a64af2462e35793f9eba (patch) | |
tree | c88785e25ddf8e2165011ffa382e1c51a4026229 | |
parent | b146b90d824ae1b080767fd0f146c474773db7dd (diff) | |
download | portage-881a74506898c4fcfae0a64af2462e35793f9eba.tar.gz portage-881a74506898c4fcfae0a64af2462e35793f9eba.tar.bz2 portage-881a74506898c4fcfae0a64af2462e35793f9eba.zip |
Bug #173284 - Do not traverse hidden directories such as .svn or .git when
search for protected files.
svn path=/main/trunk/; revision=11928
-rwxr-xr-x | bin/etc-update | 8 |
1 files changed, 5 insertions, 3 deletions
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 |