From 526b206f3d9a4b4f890838ca3ae7bc2f1c741cae Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 16 May 2010 19:05:03 -0400 Subject: Fix bug where after a large upgrade, etckeeper's automatic commit message was so long it exceeded system limits. Closes: #581678 --- debian/changelog | 2 ++ etckeeper.spec | 2 +- post-install.d/50vcs-commit | 16 ++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6e13604..1fab0e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ etckeeper (0.46) UNRELEASED; urgency=low * Support etckeeper commit --stdin + * Fix bug where after a large upgrade, etckeeper's automatic commit message + was so long it exceeded system limits. Closes: #581678 -- Joey Hess Sun, 16 May 2010 18:56:35 -0400 diff --git a/etckeeper.spec b/etckeeper.spec index 74bdedd..01611b8 100644 --- a/etckeeper.spec +++ b/etckeeper.spec @@ -1,5 +1,5 @@ Name: etckeeper -Version: 0.45 +Version: 0.46 Release: 4%{?dist} Summary: store /etc in git, mercurial, bzr or darcs diff --git a/post-install.d/50vcs-commit b/post-install.d/50vcs-commit index 6cb6bd1..7710c4a 100755 --- a/post-install.d/50vcs-commit +++ b/post-install.d/50vcs-commit @@ -2,20 +2,20 @@ set -e pl="/var/cache/etckeeper/packagelist" -NL=" -" if etckeeper unclean; then message="committing changes in /etc after $HIGHLEVEL_PACKAGE_MANAGER run" if [ -e $pl.pre-install ]; then - diff="$(etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | egrep '^[-+]')" || true - if [ -n "$diff" ]; then - message="$message$NL${NL}Package changes:$NL$diff" - fi + ( + echo "$message" + echo + echo "Package changes:" + etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | egrep '^[-+]' || true + ) | etckeeper commit --stdin + else + etckeeper commit "$(printf "$message")" fi - - etckeeper commit "$(printf "$message")" fi if [ -e $pl.pre-install ]; then -- cgit v1.2.3