From: Mike Frysinger Date: Sun, 11 Mar 2012 19:39:50 +0000 (-0400) Subject: etc-update: fix logic bug with protected files X-Git-Tag: v2.2.0_alpha91~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e9bb70344f93509e34ef117e14420a60fef5b83e;p=portage.git 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 --- 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 )