summaryrefslogtreecommitdiff
path: root/meta/classes/utils.bbclass
diff options
context:
space:
mode:
authorStephano Cetola <stephano.cetola@linux.intel.com>2016-10-03 16:32:45 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-07 16:43:48 +0100
commit25b43cb05c645e43f96bc18906441b8fdc272228 (patch)
tree3385b6ba2f3417a678603cbeb3c94581215e1354 /meta/classes/utils.bbclass
parent97e526ca10a00010987ffa3b90ec48337503a573 (diff)
downloadopenembedded-core-25b43cb05c645e43f96bc18906441b8fdc272228.tar.gz
openembedded-core-25b43cb05c645e43f96bc18906441b8fdc272228.tar.bz2
openembedded-core-25b43cb05c645e43f96bc18906441b8fdc272228.zip
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 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.bbclass10
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):
values[v].append(localdata.getVar(v, True))
values['ml'].append(item)
return values
+
+# If the user hasn't set up their name/email, set some defaults
+check_git_config() {
+ if ! git config user.email > /dev/null ; then
+ git config --local user.email "${PATCH_GIT_USER_EMAIL}"
+ fi
+ if ! git config user.name > /dev/null ; then
+ git config --local user.name "${PATCH_GIT_USER_NAME}"
+ fi
+}