summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog3
-rw-r--r--debian/cron.daily7
2 files changed, 8 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index e77c675..0a5b1b5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ etckeeper (0.43) UNRELEASED; urgency=low
* Fix cleanup of /var/cache/etckeeper/packagelist.pre-install after
an upgrade where no conffiles are changed.
+ * Prevent cron job autocommit from happening if pre-install file
+ is present, to avoid committing state in the middle of an apt run.
+ Closes: #567538
-- Joey Hess <joeyh@debian.org> Sun, 31 Jan 2010 14:36:44 -0500
diff --git a/debian/cron.daily b/debian/cron.daily
index 78e66e4..e83b570 100644
--- a/debian/cron.daily
+++ b/debian/cron.daily
@@ -3,8 +3,11 @@ set -e
if [ -x /usr/sbin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; then
. /etc/etckeeper/etckeeper.conf
if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then
- if etckeeper unclean; then
- etckeeper commit "daily autocommit" >/dev/null
+ # avoid autocommit if an install run is in progress
+ if [ ! -e /var/cache/etckeeper/packagelist.pre-install ]; then
+ if etckeeper unclean; then
+ etckeeper commit "daily autocommit" >/dev/null
+ fi
fi
fi
fi