diff options
-rwxr-xr-x | uninit.d/50vcs-uninit | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/uninit.d/50vcs-uninit b/uninit.d/50vcs-uninit index 165d415..803b0b5 100755 --- a/uninit.d/50vcs-uninit +++ b/uninit.d/50vcs-uninit @@ -18,19 +18,18 @@ fi managed_by_etckeeper="managed by etckeeper" if ! grep -q "$managed_by_etckeeper" "$file"; then - echo "etckeeper: "$file" does not contain \"$managed_by_etckeeper\" comment; not removing" exit 0 else realfile="$file" - if [ -n "`type -p tempfile`" ]; then - tempfile="tempfile" - elif [ -n "`type -p mktemp`" ]; then - tempfile="mktemp" - else - echo "etckeeper warning: can't find tempfile or mktemp" >&2 + if [ -n "`type -p tempfile`" ]; then + tempfile="tempfile" + elif [ -n "`type -p mktemp`" ]; then + tempfile="mktemp" + else + echo "etckeeper warning: can't find tempfile or mktemp" >&2 exit 1 - fi - file=$($tempfile) + fi + file=$($tempfile) otherentries= skipping= while read line; do @@ -47,7 +46,6 @@ else done <"$realfile" if [ "$otherentries" ]; then - echo "etckeeper: "$realfile" nonempty after \"$managed_by_etckeeper\" section removal; preserving other entries" mv -f "$file" "$realfile" else rm -f "$file" |