Patchwork [CONSOLIDATED,PULL,04/25] classes/buildhistory: add hostname to commit message

login
register
mail settings
Submitter Saul Wold
Date Jan. 6, 2012, 7:56 a.m.
Message ID <8c99b1f6d761910417912300443a99c38a8db9dd.1325836241.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/18545/
State New
Headers show

Comments

Saul Wold - Jan. 6, 2012, 7:56 a.m.
From: Paul Eggleton <paul.eggleton@linux.intel.com>

If we're building on multiple hosts then it's useful to have the
hostname in the commit message.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/buildhistory.bbclass |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 06d3510..ba20914 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -356,7 +356,8 @@  buildhistory_commit() {
 		repostatus=`git status --porcelain`
 		if [ "$repostatus" != "" ] ; then
 			git add ${BUILDHISTORY_DIR}/*
-			git commit ${BUILDHISTORY_DIR}/ -m "Build ${BUILDNAME} for machine ${MACHINE} configured for ${DISTRO} ${DISTRO_VERSION}" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
+			HOSTNAME=`cat /etc/hostname 2>/dev/null || echo unknown`
+			git commit ${BUILDHISTORY_DIR}/ -m "Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
 			if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
 				git push -q ${BUILDHISTORY_PUSH_REPO}
 			fi