diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-05-21 13:16:34 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-24 07:19:18 +0100 |
commit | 1b2332d3382e0776382b65eeb4c0fcba0528da4e (patch) | |
tree | 3bf65b7063805721bc1df70ae51c0cb31b536204 | |
parent | e1de8af4877d0dce6d4f1ca3a6204d8fc45a8612 (diff) | |
download | poky-1b2332d3382e0776382b65eeb4c0fcba0528da4e.tar.gz |
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 <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/buildhistory.bbclass | 9 |
1 files changed, 9 insertions, 0 deletions
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 | |||
581 | git tag -f build-minus-2 build-minus-1 > /dev/null 2>&1 || true | 581 | git tag -f build-minus-2 build-minus-1 > /dev/null 2>&1 || true |
582 | git tag -f build-minus-1 > /dev/null 2>&1 || true | 582 | git tag -f build-minus-1 > /dev/null 2>&1 || true |
583 | fi | 583 | fi |
584 | # If the user hasn't set up their name/email, set some defaults | ||
585 | # just for this repo (otherwise the commit will fail with older | ||
586 | # versions of git) | ||
587 | if ! git config user.email > /dev/null ; then | ||
588 | git config --local user.email "buildhistory@${DISTRO}" | ||
589 | fi | ||
590 | if ! git config user.name > /dev/null ; then | ||
591 | git config --local user.name "buildhistory" | ||
592 | fi | ||
584 | # Check if there are new/changed files to commit (other than metadata-revs) | 593 | # Check if there are new/changed files to commit (other than metadata-revs) |
585 | repostatus=`git status --porcelain | grep -v " metadata-revs$"` | 594 | repostatus=`git status --porcelain | grep -v " metadata-revs$"` |
586 | HOSTNAME=`hostname 2>/dev/null || echo unknown` | 595 | HOSTNAME=`hostname 2>/dev/null || echo unknown` |