diff options
author | Joey Hess <joey@kitenet.net> | 2011-11-25 20:02:11 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-11-25 20:02:58 -0400 |
commit | 087c3e8ab0f7481706f9d31ab3dbf68974c52e86 (patch) | |
tree | 3dba99cdaca55ee31b93aa3e8313978cf10ee4f5 /debian | |
parent | 501b510631ad647d6425774283a93e2a8e7f3ad0 (diff) |
cron.daily: Don't stop committing when a stale packagelist.pre-install file exists.
The file could exist because AVOID_COMMIT_BEFORE_INSTALL is set,
or just because the install was interrupted/system crashed etc.
If the file's more than a day old, continue with autocommit.
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 3 | ||||
-rw-r--r-- | debian/cron.daily | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index 73cf0de..bcf0d31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,9 @@ etckeeper (0.58) UNRELEASED; urgency=low Thanks to Miklos Vajna, whose patch in 2008 was deferred because -A was then too new, and languished in a branch until found today. * Optimised metadata storage. + * cron.daily: Don't stop committing when a stale packagelist.pre-install + file exists. + Thanks to gulikoza for noticing this bug. -- Joey Hess <joeyh@debian.org> Fri, 25 Nov 2011 12:00:55 -0400 diff --git a/debian/cron.daily b/debian/cron.daily index b46e7a2..ae41795 100644 --- a/debian/cron.daily +++ b/debian/cron.daily @@ -4,7 +4,11 @@ if [ -x /usr/bin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; then . /etc/etckeeper/etckeeper.conf if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then # avoid autocommit if an install run is in progress - if [ ! -e /var/cache/etckeeper/packagelist.pre-install ]; then + lockfile=/var/cache/etckeeper/packagelist.pre-install + if [ -e "$pe" ] && [ -n "$(find "$lockfile" -mtime +1)" ]; then + rm -f "$lockfile" # stale + fi + if [ ! -e "$lockfile" ]; then AVOID_SPECIAL_FILE_WARNING=1 export AVOID_SPECIAL_FILE_WARNING if etckeeper unclean; then |