Comment 2 for bug 661024

Revision history for this message
Thierry Carrez (ttx) wrote : Re: etckeeper fail to work when installed during installation

Analysis:
In the case of an early install, the logic to determine USER in /etc/etckeeper/commit.d/50vcs-commit fails to yield a valid USER, so EMAIL is not set when bzr commit is called (no name being stored in bzr whoami, this fails)

Solution would be to do something like:

ORIG_USER=$USER
USER=
...
  if [ -n "$USER" ]; then
      export EMAIL="$USER <$USER@$hostname>"
  else
      bzr whoami || export EMAIL="$ORIG_USER <$ORIG_USER@$hostname>"
  fi

This avoids setting bzr whoami artificially at install-time, still prefers stored creds if any are present, but defaulting to something valid rather than failing in the corner case of this bug.

Reducing priority since this doesn't affect post-install installations of etckeeper. i'll fix this if nobody beats me to it.