summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorDexuan Cui <dexuan.cui@intel.com>2011-06-28 13:18:59 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-05 13:41:40 +0100
commitf271498638a9da271ed5da973666fe4a7bd0ac63 (patch)
treed1dda1f708dbabcea1b373bf659f2603d6740f00 /meta
parentd0b55fb8115c5ad311ed5ad3192902f7746d5cca (diff)
downloadopenembedded-core-f271498638a9da271ed5da973666fe4a7bd0ac63.tar.gz
openembedded-core-f271498638a9da271ed5da973666fe4a7bd0ac63.tar.bz2
openembedded-core-f271498638a9da271ed5da973666fe4a7bd0ac63.zip
base.bbclass: show layer's branches/revisions in the banner info
The patch removes METADATA_BRANCH and METADATA_REVISION, and treats the meta/ in the same way as other layers. In the case some layers belonging to the same repo, the branch and revision are only printed once, but all the layer names are still printed. An example output can be: OE Build Configuration: BB_VERSION = "1.13.1" TARGET_ARCH = "i586" TARGET_OS = "linux" MACHINE = "emenlow" DISTRO = "poky" DISTRO_VERSION = "1.0+snapshot-20110702" TARGET_FPU = "" meta meta-yocto = "dcui/banner_v3:4b712dba68a98c827b8f3d0242da9153c4f65473" meta-emenlow meta-sugarbay meta-n450 = "dcui/test1:76d1178ba1a43cf6457c89717134aeb9f1275fae" Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/base.bbclass23
1 files changed, 22 insertions, 1 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index c82dae83e8..0c2c546925 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -166,8 +166,29 @@ python base_eventhandler() {
if name.startswith("BuildStarted"):
bb.data.setVar( 'BB_VERSION', bb.__version__, e.data )
- statusvars = ['BB_VERSION', 'METADATA_BRANCH', 'METADATA_REVISION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TARGET_FPU']
+ statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TARGET_FPU']
statuslines = ["%-17s = \"%s\"" % (i, bb.data.getVar(i, e.data, 1) or '') for i in statusvars]
+
+ layers = (data.getVar("BBLAYERS", e.data, 1) or "").split()
+ layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \
+ base_get_metadata_git_branch(i, None).strip(), \
+ base_get_metadata_git_revision(i, None)) \
+ for i in layers]
+ i = len(layers_branch_rev)-1
+ p1 = layers_branch_rev[i].find("=")
+ s1= layers_branch_rev[i][p1:]
+ while i > 0:
+ p2 = layers_branch_rev[i-1].find("=")
+ s2= layers_branch_rev[i-1][p2:]
+ if s1 == s2:
+ layers_branch_rev[i-1] = layers_branch_rev[i-1][0:p2]
+ i -= 1
+ else:
+ i -= 1
+ p1 = layers_branch_rev[i].find("=")
+ s1= layers_branch_rev[i][p1:]
+
+ statuslines += layers_branch_rev
statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines)
print statusmsg