summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-08-15 18:04:36 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-16 11:37:32 +0100
commit34fb802b2170f0fe208e54e7a4d18f663db72f90 (patch)
tree8fec5db822d34ec24f764969690dc66aa32418ae /meta
parent85e4a77138381a6086d5ebd3a28cb5a94bc26a19 (diff)
downloadopenembedded-core-34fb802b2170f0fe208e54e7a4d18f663db72f90.tar.gz
openembedded-core-34fb802b2170f0fe208e54e7a4d18f663db72f90.tar.bz2
openembedded-core-34fb802b2170f0fe208e54e7a4d18f663db72f90.zip
classes/buildhistory: show command line in commit message
Record the bitbake command line in the commit message as a further context indication. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/buildhistory.bbclass13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index b2e5cc50e8..6fb1ba646d 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -495,6 +495,14 @@ def buildhistory_get_sdkvars(d):
return outputvars(sdkvars, listvars, d)
+def buildhistory_get_cmdline(d):
+ if sys.argv[0].endswith('bin/bitbake'):
+ bincmd = 'bitbake'
+ else:
+ bincmd = sys.argv[0]
+ return '%s %s' % (bincmd, ' '.join(sys.argv[1:]))
+
+
buildhistory_commit() {
if [ ! -d ${BUILDHISTORY_DIR} ] ; then
# Code above that creates this dir never executed, so there can't be anything to commit
@@ -514,18 +522,19 @@ END
# Check if there are new/changed files to commit (other than metadata-revs)
repostatus=`git status --porcelain | grep -v " metadata-revs$"`
HOSTNAME=`hostname 2>/dev/null || echo unknown`
+ CMDLINE="${@buildhistory_get_cmdline(d)}"
if [ "$repostatus" != "" ] ; then
git add -A .
# porcelain output looks like "?? packages/foo/bar"
# Ensure we commit metadata-revs with the first commit
for entry in `echo "$repostatus" | awk '{print $2}' | awk -F/ '{print $1}' | sort | uniq` ; do
- git commit $entry metadata-revs -m "$entry: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
+ git commit $entry metadata-revs -m "$entry: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" -m "cmd: $CMDLINE" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
done
if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
git push -q ${BUILDHISTORY_PUSH_REPO}
fi
else
- git commit ${BUILDHISTORY_DIR}/ --allow-empty -m "No changes: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
+ git commit ${BUILDHISTORY_DIR}/ --allow-empty -m "No changes: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" -m "cmd: $CMDLINE" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
fi) || true
}