diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-08-26 11:05:18 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-30 12:36:12 +0100 |
commit | d14ffaf6a366442bcf88e44ee3e105f9dea1e69c (patch) | |
tree | bff6397199056dece0d9e52ff456caa6ff7c449c /meta | |
parent | 734411a9e633f5b1459216e4cc5175f267d8a668 (diff) | |
download | poky-d14ffaf6a366442bcf88e44ee3e105f9dea1e69c.tar.gz |
classes/buildhistory: add build result to commit message
We have the command in the commit message, we might as well have the
build result as well (succeeded/failed and whether or not it was
interrupted by the user). The interrupted part relies upon a change to
BitBake to extend the BuildCompleted event to include an attribute for
that, but will not fail if the attribute is not present.
(From OE-Core rev: 6ca7f5c0d0f024ae5d21368188e3428534cab2a4)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/buildhistory.bbclass | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 135d17a837..4db0441993 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
@@ -593,12 +593,27 @@ buildhistory_single_commit() { | |||
593 | commitopts="$3 metadata-revs" | 593 | commitopts="$3 metadata-revs" |
594 | item="$3" | 594 | item="$3" |
595 | fi | 595 | fi |
596 | if [ "${BUILDHISTORY_BUILD_FAILURES}" = "0" ] ; then | ||
597 | result="succeeded" | ||
598 | else | ||
599 | result="failed" | ||
600 | fi | ||
601 | case ${BUILDHISTORY_BUILD_INTERRUPTED} in | ||
602 | 1) | ||
603 | result="$result (interrupted)" | ||
604 | ;; | ||
605 | 2) | ||
606 | result="$result (force interrupted)" | ||
607 | ;; | ||
608 | esac | ||
596 | commitmsgfile=`mktemp` | 609 | commitmsgfile=`mktemp` |
597 | cat > $commitmsgfile << END | 610 | cat > $commitmsgfile << END |
598 | $item: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $2 | 611 | $item: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $2 |
599 | 612 | ||
600 | cmd: $1 | 613 | cmd: $1 |
601 | 614 | ||
615 | result: $result | ||
616 | |||
602 | metadata revisions: | 617 | metadata revisions: |
603 | END | 618 | END |
604 | cat ${BUILDHISTORY_DIR}/metadata-revs >> $commitmsgfile | 619 | cat ${BUILDHISTORY_DIR}/metadata-revs >> $commitmsgfile |
@@ -659,7 +674,11 @@ python buildhistory_eventhandler() { | |||
659 | if e.data.getVar('BUILDHISTORY_FEATURES', True).strip(): | 674 | if e.data.getVar('BUILDHISTORY_FEATURES', True).strip(): |
660 | if e.data.getVar("BUILDHISTORY_COMMIT", True) == "1": | 675 | if e.data.getVar("BUILDHISTORY_COMMIT", True) == "1": |
661 | bb.note("Writing buildhistory") | 676 | bb.note("Writing buildhistory") |
662 | bb.build.exec_func("buildhistory_commit", e.data) | 677 | localdata = bb.data.createCopy(e.data) |
678 | localdata.setVar('BUILDHISTORY_BUILD_FAILURES', str(e._failures)) | ||
679 | interrupted = getattr(e, '_interrupted', 0) | ||
680 | localdata.setVar('BUILDHISTORY_BUILD_INTERRUPTED', str(interrupted)) | ||
681 | bb.build.exec_func("buildhistory_commit", localdata) | ||
663 | } | 682 | } |
664 | 683 | ||
665 | addhandler buildhistory_eventhandler | 684 | addhandler buildhistory_eventhandler |