summaryrefslogtreecommitdiff
path: root/unclean.d
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-15 14:21:46 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-15 14:21:46 -0500
commitc8f16796c6c72251814626ccf911d8f025cc60f3 (patch)
tree17c99c0cc0570d2167ceb3cf888d60df304a757a /unclean.d
parent45fa1c5a4d911503b545df62c4e276807063dc4e (diff)
* Convert the directory parameter of etckeeper into "-d directory".
* Pass other patameters on from etckeeper to the .d scripts. * Stop using run-parts for various reasons. * Split out a commit.d that contains committing code that's used by both the pre-install.d and post-install.d scripts. * Split out an unclean.d that tests if the WC contains uncommitted changes. * Add preinst code to remove old post-install.d scripts.
Diffstat (limited to 'unclean.d')
-rwxr-xr-xunclean.d/50test8
-rw-r--r--unclean.d/README2
2 files changed, 10 insertions, 0 deletions
diff --git a/unclean.d/50test b/unclean.d/50test
new file mode 100755
index 0000000..0495815
--- /dev/null
+++ b/unclean.d/50test
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+
+if [ "$VCS" = git ]; then
+ [ -d .git ] && ! LANG=C git-status 2>&1 | grep -q "working directory clean"
+elif [ "$VCS" = hg ]; then
+ [ -d .hg ] && ! hg status 2>&1 | wc -l | grep -q "^0$"
+fi
diff --git a/unclean.d/README b/unclean.d/README
new file mode 100644
index 0000000..74bfbdd
--- /dev/null
+++ b/unclean.d/README
@@ -0,0 +1,2 @@
+Files in this directory are used to test if the working copy has
+uncommitted changes.