summaryrefslogtreecommitdiffstats
path: root/bin/etc-update
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-03-11 15:39:50 -0400
committerMike Frysinger <vapier@gentoo.org>2012-03-11 15:41:42 -0400
commite9bb70344f93509e34ef117e14420a60fef5b83e (patch)
treed5e6542f2f99a7eff3eaf8dc0a25286672e9a588 /bin/etc-update
parent157c9c0de811b64326ebf09cc95a59b34cbc0547 (diff)
downloadportage-e9bb70344f93509e34ef117e14420a60fef5b83e.tar.gz
portage-e9bb70344f93509e34ef117e14420a60fef5b83e.tar.bz2
portage-e9bb70344f93509e34ef117e14420a60fef5b83e.zip
etc-update: fix logic bug with protected files
The rewrite introduced a slight bug with protected files. Fix that, and rework the code slightly to make it obvious that we want a diff set of options for files and dirs. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'bin/etc-update')
-rwxr-xr-xbin/etc-update7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/etc-update b/bin/etc-update
index 644512a96..75c6ba1b5 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -75,13 +75,14 @@ scan() {
[[ -w ${path} ]] || die "Need write access to ${path}"
- # 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
local my_basename="${path##*/}"
path="${path%/*}"
- find_opts+=( -maxdepth 1 -name "._cfg????_${my_basename}" )
+ find_opts=( -maxdepth 1 -name "._cfg????_${my_basename}" )
+ else
+ # Do not traverse hidden directories such as .svn or .git.
+ find_opts=( -name '.*' -type d -prune -o -name '._cfg????_*' )
fi
find_opts+=( ! -name '.*~' ! -iname '.*.bak' -print )