From a1eda6d10d7b2d712e9e248e9a48970bec53d5f0 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Mon, 30 Nov 2015 22:24:16 -0600 Subject: bzr: make sure EMAIL is defined Bzr refuses to commit changes before name and email are configured. If etckeeper is run very early during install, it can happen that these are in fac tnot yet set up. This patch ensures that they are configured. It has been in the Ubuntu delta for many years. Reference: https://bugs.launchpad.net/ubuntu/+source/etckeeper/+bug/661024 Signed-off-by: Serge Hallyn --- commit.d/50vcs-commit | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commit.d/50vcs-commit b/commit.d/50vcs-commit index 43af353..569ba6c 100755 --- a/commit.d/50vcs-commit +++ b/commit.d/50vcs-commit @@ -28,6 +28,7 @@ if [ -n "$dnsdomainname" ]; then hostname="$hostname.$dnsdomainname" fi +ORIG_USER=$USER USER= if [ -n "$SUDO_USER" ]; then USER="$SUDO_USER" @@ -95,6 +96,8 @@ elif [ "$VCS" = bzr ] && [ -d .bzr ]; then if [ -z "$EMAIL" ] && [ -n "$USER" ]; then EMAIL="$USER <$USER@$hostname>" export EMAIL + else + bzr whoami || export EMAIL="$ORIG_USER <$ORIG_USER@$hostname>" fi if [ -n "$logfile" ]; then bzr commit $BZR_COMMIT_OPTIONS -F "$logfile" -- cgit v1.2.3