From 6e7aab39cced00eae03040753c85527aab573319 Mon Sep 17 00:00:00 2001 From: "David De La Harpe Golden (Squared Financial)" Date: Thu, 31 May 2012 18:27:06 +0100 Subject: Preserve unmanaged ignore file entries on uninit (#673996) Signed-off-by: David De La Harpe Golden (Squared Financial) --- update-ignore.d/01update-ignore | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'update-ignore.d/01update-ignore') diff --git a/update-ignore.d/01update-ignore b/update-ignore.d/01update-ignore index b6acf17..8cf524a 100755 --- a/update-ignore.d/01update-ignore +++ b/update-ignore.d/01update-ignore @@ -160,8 +160,14 @@ writefile () { if [ -e "$file" ]; then if ! grep -q "$managed_by_etckeeper" "$file"; then - echo "etckeeper: "$file" does not contain \"$managed_by_etckeeper\" comment; not updating" - exit 1 + if [ "$1" != "-a" ]; then + echo "etckeeper: "$file" does not contain \"$managed_by_etckeeper\" comment; not updating" + exit 1 + else + echo "etckeeper: "$file" exists but does not contain \"$managed_by_etckeeper\" comment; updating" + writefile + exit 0 + fi fi realfile="$file" if [ -n "`type -p tempfile`" ]; then -- cgit v1.2.3