summaryrefslogtreecommitdiff
path: root/update-ignore.d/01update-ignore
diff options
context:
space:
mode:
authorDavid De La Harpe Golden (Squared Financial) <dgolden@squaredfinancial.com>2012-05-31 18:27:06 +0100
committerJoey Hess <joey@kitenet.net>2012-06-02 18:05:30 -0400
commit6e7aab39cced00eae03040753c85527aab573319 (patch)
tree30431d5c28204fe2797668bfa9b6691089ae383b /update-ignore.d/01update-ignore
parent40eeedebb6be23035aea9d15aed1be706479ce79 (diff)
Preserve unmanaged ignore file entries on uninit (#673996)
Signed-off-by: David De La Harpe Golden (Squared Financial) <dgolden@squaredfinancial.com>
Diffstat (limited to 'update-ignore.d/01update-ignore')
-rwxr-xr-xupdate-ignore.d/01update-ignore10
1 files changed, 8 insertions, 2 deletions
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