From 2890e88e8b8ddeba83bc371518ccdbe459f0328e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 31 Jan 2010 14:42:15 -0500 Subject: 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 --- debian/changelog | 3 +++ debian/cron.daily | 7 +++++-- 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 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 -- cgit v1.2.3