mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 03:49:32 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
734411a9e6
commit
d14ffaf6a3
@@ -593,12 +593,27 @@ buildhistory_single_commit() {
|
|||||||
commitopts="$3 metadata-revs"
|
commitopts="$3 metadata-revs"
|
||||||
item="$3"
|
item="$3"
|
||||||
fi
|
fi
|
||||||
|
if [ "${BUILDHISTORY_BUILD_FAILURES}" = "0" ] ; then
|
||||||
|
result="succeeded"
|
||||||
|
else
|
||||||
|
result="failed"
|
||||||
|
fi
|
||||||
|
case ${BUILDHISTORY_BUILD_INTERRUPTED} in
|
||||||
|
1)
|
||||||
|
result="$result (interrupted)"
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
result="$result (force interrupted)"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
commitmsgfile=`mktemp`
|
commitmsgfile=`mktemp`
|
||||||
cat > $commitmsgfile << END
|
cat > $commitmsgfile << END
|
||||||
$item: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $2
|
$item: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $2
|
||||||
|
|
||||||
cmd: $1
|
cmd: $1
|
||||||
|
|
||||||
|
result: $result
|
||||||
|
|
||||||
metadata revisions:
|
metadata revisions:
|
||||||
END
|
END
|
||||||
cat ${BUILDHISTORY_DIR}/metadata-revs >> $commitmsgfile
|
cat ${BUILDHISTORY_DIR}/metadata-revs >> $commitmsgfile
|
||||||
@@ -659,7 +674,11 @@ python buildhistory_eventhandler() {
|
|||||||
if e.data.getVar('BUILDHISTORY_FEATURES', True).strip():
|
if e.data.getVar('BUILDHISTORY_FEATURES', True).strip():
|
||||||
if e.data.getVar("BUILDHISTORY_COMMIT", True) == "1":
|
if e.data.getVar("BUILDHISTORY_COMMIT", True) == "1":
|
||||||
bb.note("Writing buildhistory")
|
bb.note("Writing buildhistory")
|
||||||
bb.build.exec_func("buildhistory_commit", e.data)
|
localdata = bb.data.createCopy(e.data)
|
||||||
|
localdata.setVar('BUILDHISTORY_BUILD_FAILURES', str(e._failures))
|
||||||
|
interrupted = getattr(e, '_interrupted', 0)
|
||||||
|
localdata.setVar('BUILDHISTORY_BUILD_INTERRUPTED', str(interrupted))
|
||||||
|
bb.build.exec_func("buildhistory_commit", localdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
addhandler buildhistory_eventhandler
|
addhandler buildhistory_eventhandler
|
||||||
|
|||||||
Reference in New Issue
Block a user