summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-11-25 14:34:17 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2011-11-25 14:34:17 +0100
commit8130a2f78cfec19f5d0e829bdec133a39e2672fd (patch)
tree43ecc296293b57365d98bbaacad0c89cd4fba9d1
parent7019fbb50796fedcedef6ff92981a7f26659a251 (diff)
downloadmeta-openembedded-8130a2f78cfec19f5d0e829bdec133a39e2672fd.tar.gz
testlab bbclass: output version info on all layers
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
-rw-r--r--meta-oe/classes/testlab.bbclass27
1 files changed, 26 insertions, 1 deletions
diff --git a/meta-oe/classes/testlab.bbclass b/meta-oe/classes/testlab.bbclass
index fd37242b9..b26e2a13c 100644
--- a/meta-oe/classes/testlab.bbclass
+++ b/meta-oe/classes/testlab.bbclass
@@ -77,7 +77,8 @@ if [ -e ${IMAGE_ROOTFS}/etc/opkg ] && [ "${ONLINE_PACKAGE_MANAGEMENT}" = "full"
77 mkdir -p ${TESTLABREMOTEDIR}/${TESTLABLOGDIR} 77 mkdir -p ${TESTLABREMOTEDIR}/${TESTLABLOGDIR}
78 cp ${TESTLAB_DIR}/*package* ${TESTLAB_DIR}/depends.dot ${TESTLABREMOTEDIR}/${TESTLABLOGDIR} 78 cp ${TESTLAB_DIR}/*package* ${TESTLAB_DIR}/depends.dot ${TESTLABREMOTEDIR}/${TESTLABLOGDIR}
79 # force change to record builds where the testlab contents didn't change, but other things (e.g. git rev) did 79 # force change to record builds where the testlab contents didn't change, but other things (e.g. git rev) did
80 echo "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION} using branch ${METADATA_BRANCH} and revision ${METADATA_REVISION} " > ${TESTLABREMOTEDIR}/${TESTLABLOGDIR}/build-id 80 echo "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION}" > ${TESTLABREMOTEDIR}/${TESTLABLOGDIR}/build-id
81 echo "${@testlab_get_layers(bb, d)}" >> ${TESTLABREMOTEDIR}/${TESTLABLOGDIR}/build-id
81 # This runs inside fakeroot, so the git author is listed as root (or whatever root configured it to be) :( 82 # This runs inside fakeroot, so the git author is listed as root (or whatever root configured it to be) :(
82 ( cd ${TESTLABREMOTEDIR}/ 83 ( cd ${TESTLABREMOTEDIR}/
83 git add ${TESTLABLOGDIR}/* 84 git add ${TESTLABLOGDIR}/*
@@ -87,3 +88,27 @@ fi
87} 88}
88 89
89IMAGE_POSTPROCESS_COMMAND += " do_testlab ;" 90IMAGE_POSTPROCESS_COMMAND += " do_testlab ;"
91
92def testlab_get_layers(bb, d):
93 layers = (bb.data.getVar("BBLAYERS", d, 1) or "").split()
94 layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \
95 base_get_metadata_git_branch(i, None).strip().strip('()'), \
96 base_get_metadata_git_revision(i, None)) \
97 for i in layers]
98 i = len(layers_branch_rev)-1
99 p1 = layers_branch_rev[i].find("=")
100 s1= layers_branch_rev[i][p1:]
101 while i > 0:
102 p2 = layers_branch_rev[i-1].find("=")
103 s2= layers_branch_rev[i-1][p2:]
104 if s1 == s2:
105 layers_branch_rev[i-1] = layers_branch_rev[i-1][0:p2]
106 i -= 1
107 else:
108 i -= 1
109 p1 = layers_branch_rev[i].find("=")
110 s1= layers_branch_rev[i][p1:]
111
112 layertext = "Configured Openembedded layers:\n%s\n" % '\n'.join(layers_branch_rev)
113 return layertext
114