diff options
author | Stephano Cetola <stephano.cetola@linux.intel.com> | 2016-10-03 16:32:45 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-10-07 16:43:57 +0100 |
commit | ef7828c9f2955dfde09a0c83694c8a67cdc34b40 (patch) | |
tree | 4c933927823ebc4be8ac7ff60ca44bb8b8f3fd57 /meta/classes/utils.bbclass | |
parent | 4454d024485d671ded558e3c617900f6fad414a4 (diff) | |
download | poky-ef7828c9f2955dfde09a0c83694c8a67cdc34b40.tar.gz |
utils.bbclass: add function to check for git config user
If attempting to patch a git repo without a proper git config setup,
an error will occur saying user.name/user.email are needed by git
am/apply. After some code was removed from kernel-yocto, it was
simple enough to reproduce this error by creating a kernel patch and
using a container to build.
This patch abstracts out functionality that existed in buildhistory
for use in other classes. It also adds a call to this functionality
to the kernel-yocto class.
Fixes [YOCTO #10346]
introduced in OE-core revision
0f698dfd1c8bbc0d53ae7977e26685a7a3df52a3
(From OE-Core rev: 25b43cb05c645e43f96bc18906441b8fdc272228)
Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/utils.bbclass')
-rw-r--r-- | meta/classes/utils.bbclass | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass index 800b56578c..dbb5e4cbbc 100644 --- a/meta/classes/utils.bbclass +++ b/meta/classes/utils.bbclass | |||
@@ -419,3 +419,13 @@ def all_multilib_tune_list(vars, d): | |||
419 | values[v].append(localdata.getVar(v, True)) | 419 | values[v].append(localdata.getVar(v, True)) |
420 | values['ml'].append(item) | 420 | values['ml'].append(item) |
421 | return values | 421 | return values |
422 | |||
423 | # If the user hasn't set up their name/email, set some defaults | ||
424 | check_git_config() { | ||
425 | if ! git config user.email > /dev/null ; then | ||
426 | git config --local user.email "${PATCH_GIT_USER_EMAIL}" | ||
427 | fi | ||
428 | if ! git config user.name > /dev/null ; then | ||
429 | git config --local user.name "${PATCH_GIT_USER_NAME}" | ||
430 | fi | ||
431 | } | ||