diff options
Diffstat (limited to 'meta-oe/classes/testlab.bbclass')
-rw-r--r-- | meta-oe/classes/testlab.bbclass | 27 |
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 | ||
89 | IMAGE_POSTPROCESS_COMMAND += " do_testlab ;" | 90 | IMAGE_POSTPROCESS_COMMAND += " do_testlab ;" |
91 | |||
92 | def 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 | |||