git commit needs a user name and email even if --author is set. In most
cases users have ~/.gitconfig but in some cases the build user account
does not have these set which breaks the build.

Change-Id: Idd35df626332756ba5bd61d9273c76c7e63ed3f9
Signed-off-by: Mikko Rapeli <[email protected]>
---
 meta/classes/buildhistory.bbclass | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/classes/buildhistory.bbclass 
b/meta/classes/buildhistory.bbclass
index 211dcf1..dbd27b0 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -14,7 +14,9 @@ BUILDHISTORY_DIR_PACKAGE = 
"${BUILDHISTORY_DIR}/packages/${MULTIMACH_TARGET_SYS}
 BUILDHISTORY_DIR_SDK = "${BUILDHISTORY_DIR}/sdk/${SDK_NAME}/${IMAGE_BASENAME}"
 BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd /etc/group"
 BUILDHISTORY_COMMIT ?= "0"
-BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>"
+BUILDHISTORY_COMMIT_USER_NAME ?= "buildhistory"
+BUILDHISTORY_COMMIT_USER_EMAIL ?= "<buildhistory@${DISTRO}>"
+BUILDHISTORY_COMMIT_AUTHOR ?= "${BUILDHISTORY_COMMIT_USER_NAME} 
${BUILDHISTORY_COMMIT_USER_EMAIL}"
 BUILDHISTORY_PUSH_REPO ?= ""
 
 SSTATEPOSTINSTFUNCS_append = " buildhistory_emit_pkghistory"
@@ -586,6 +588,11 @@ END
                HOSTNAME=`hostname 2>/dev/null || echo unknown`
                CMDLINE="${@buildhistory_get_cmdline(d)}"
                if [ "$repostatus" != "" ] ; then
+                       # git commit needs this setup, done every time before
+                       # commit to support name and email changes via
+                       # bitbake configuration
+                       git config user.name "${BUILDHISTORY_COMMIT_USER_NAME}"
+                       git config user.email 
"${BUILDHISTORY_COMMIT_USER_EMAIL}"
                        git add -A .
                        # porcelain output looks like "?? packages/foo/bar"
                        # Ensure we commit metadata-revs with the first commit
-- 
2.1.4

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to