etc-update: ignore non-existent CONFIG_PROTECT
authorZac Medico <zmedico@gentoo.org>
Sat, 17 Mar 2012 22:56:33 +0000 (15:56 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 17 Mar 2012 22:56:33 +0000 (15:56 -0700)
bin/etc-update

index 135de4557f9f9564f3026f138a482f4ae6124d18..b0765207527411a086d1f57b445d792c41ee0ccc 100755 (executable)
@@ -73,8 +73,6 @@ scan() {
        for path in ${SCAN_PATHS} ; do
                path="${EROOT%/}${path}"
 
-               [[ -w ${path} ]] || die "Need write access to ${path}"
-
                if [[ ! -d ${path} ]] ; then
                        [[ ! -f ${path} ]] && continue
                        local my_basename="${path##*/}"
@@ -86,6 +84,11 @@ scan() {
                fi
                find_opts+=( ! -name '.*~' ! -iname '.*.bak' -print )
 
+               if [ ! -w "${path}" ] ; then
+                       [ -e "${path}" ] || continue
+                       die "Need write access to ${path}"
+               fi
+
                local file ofile b=$'\001'
                for file in $(find "${path}"/ "${find_opts[@]}" |
                              sed \