]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/buildhistory: use hostname instead of reading /etc/hostname
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 14 Feb 2012 10:55:46 +0000 (10:55 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Feb 2012 17:48:38 +0000 (17:48 +0000)
For the purposes of querying the hostname to include it in the commit
message, it seems "cat /etc/hostname" does not work on the Yocto Project
autobuilder machines, and it's likely that the hostname command will be
more generally reliable, so use that instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
meta/classes/buildhistory.bbclass

index 3fbe3a8576daba9a2b1ef5aaf6083ccc9144d2ca..dfc9b73919a98950707ff6fbf452e293019b4bb6 100644 (file)
@@ -383,7 +383,7 @@ buildhistory_commit() {
                repostatus=`git status --porcelain`
                if [ "$repostatus" != "" ] ; then
                        git add ${BUILDHISTORY_DIR}/*
-                       HOSTNAME=`cat /etc/hostname 2>/dev/null || echo unknown`
+                       HOSTNAME=`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}