summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-11-30 16:39:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-12-01 16:54:07 +0000
commit8e2c57876764a498760cc310187f96e9126e3428 (patch)
treee94c171bc5549ac6109ff17ee45ecb5dea639ccb /meta/classes/base.bbclass
parent64f3e247df44f4f165d9ae0574d9c0c56e0a4232 (diff)
downloadpoky-8e2c57876764a498760cc310187f96e9126e3428.tar.gz
classes/base: split out metadata revision code to separate function
Split out a new function get_layers_branch_rev() which returns a list of the metadata layers and their revisions. This enables reuse in other places, such as buildhistory.bbclass. (From OE-Core rev: c1bca5d95051362320008f16d8f5acd87faa34ac) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass44
1 files changed, 24 insertions, 20 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index a95dfd9a08..ea5349852b 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -200,6 +200,29 @@ def preferred_ml_updates(d):
200 extramp.append(virt + pref + "-" + p) 200 extramp.append(virt + pref + "-" + p)
201 d.setVar("MULTI_PROVIDER_WHITELIST", " ".join(mp + extramp)) 201 d.setVar("MULTI_PROVIDER_WHITELIST", " ".join(mp + extramp))
202 202
203
204def get_layers_branch_rev(d):
205 layers = (d.getVar("BBLAYERS", 1) or "").split()
206 layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \
207 base_get_metadata_git_branch(i, None).strip(), \
208 base_get_metadata_git_revision(i, None)) \
209 for i in layers]
210 i = len(layers_branch_rev)-1
211 p1 = layers_branch_rev[i].find("=")
212 s1 = layers_branch_rev[i][p1:]
213 while i > 0:
214 p2 = layers_branch_rev[i-1].find("=")
215 s2= layers_branch_rev[i-1][p2:]
216 if s1 == s2:
217 layers_branch_rev[i-1] = layers_branch_rev[i-1][0:p2]
218 i -= 1
219 else:
220 i -= 1
221 p1 = layers_branch_rev[i].find("=")
222 s1= layers_branch_rev[i][p1:]
223 return layers_branch_rev
224
225
203addhandler base_eventhandler 226addhandler base_eventhandler
204python base_eventhandler() { 227python base_eventhandler() {
205 from bb.event import getName 228 from bb.event import getName
@@ -211,26 +234,7 @@ python base_eventhandler() {
211 statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TUNE_FEATURES', 'TARGET_FPU'] 234 statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TUNE_FEATURES', 'TARGET_FPU']
212 statuslines = ["%-17s = \"%s\"" % (i, e.data.getVar(i, 1) or '') for i in statusvars] 235 statuslines = ["%-17s = \"%s\"" % (i, e.data.getVar(i, 1) or '') for i in statusvars]
213 236
214 layers = (e.data.getVar("BBLAYERS", 1) or "").split() 237 statuslines += get_layers_branch_rev(e.data)
215 layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \
216 base_get_metadata_git_branch(i, None).strip(), \
217 base_get_metadata_git_revision(i, None)) \
218 for i in layers]
219 i = len(layers_branch_rev)-1
220 p1 = layers_branch_rev[i].find("=")
221 s1= layers_branch_rev[i][p1:]
222 while i > 0:
223 p2 = layers_branch_rev[i-1].find("=")
224 s2= layers_branch_rev[i-1][p2:]
225 if s1 == s2:
226 layers_branch_rev[i-1] = layers_branch_rev[i-1][0:p2]
227 i -= 1
228 else:
229 i -= 1
230 p1 = layers_branch_rev[i].find("=")
231 s1= layers_branch_rev[i][p1:]
232
233 statuslines += layers_branch_rev
234 statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines) 238 statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines)
235 bb.plain(statusmsg) 239 bb.plain(statusmsg)
236 240