From 1b2332d3382e0776382b65eeb4c0fcba0528da4e Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 21 May 2015 13:16:34 +0100 Subject: classes/buildhistory: ensure that git user email and name are set The git user.email and user.name settings must be set or the commit to the buildhistory repo (when BUILDHISTORY_COMMIT is set to "1") will fail. If the user hasn't set these, set some dummy values since the actual value is unlikely to be particularly useful and it's far worse for the commit not to be done leaving the repository in a partially set up state. Prompted by [YOCTO #6973]. (From OE-Core rev: f62255bfa6c5a322c867b7c4ea5686ea7bfab3fe) Signed-off-by: Paul Eggleton Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/classes/buildhistory.bbclass | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'meta/classes/buildhistory.bbclass') diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 211dcf18b5..777aabc55d 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -581,6 +581,15 @@ END git tag -f build-minus-2 build-minus-1 > /dev/null 2>&1 || true git tag -f build-minus-1 > /dev/null 2>&1 || true fi + # If the user hasn't set up their name/email, set some defaults + # just for this repo (otherwise the commit will fail with older + # versions of git) + if ! git config user.email > /dev/null ; then + git config --local user.email "buildhistory@${DISTRO}" + fi + if ! git config user.name > /dev/null ; then + git config --local user.name "buildhistory" + fi # Check if there are new/changed files to commit (other than metadata-revs) repostatus=`git status --porcelain | grep -v " metadata-revs$"` HOSTNAME=`hostname 2>/dev/null || echo unknown` -- cgit v1.2.3-54-g00ecf