From e9bb70344f93509e34ef117e14420a60fef5b83e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 11 Mar 2012 15:39:50 -0400 Subject: 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 --- bin/etc-update | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bin') 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 ) -- cgit v1.2.3-1-g7c22