summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorJeremy Laine <jeremy.laine@m4x.org>2008-05-21 13:18:46 +0000
committerJeremy Laine <jeremy.laine@m4x.org>2008-05-21 13:18:46 +0000
commit33f7b07fc5083c5951fc4dbbd64409752bde7c83 (patch)
tree6b5fbc264e1623ae9610dceeb8351123f8196d84 /classes
parent4840fa10dab8c64c7f9498feb1a5f1719a8c0044 (diff)
base.bbclass: add a METADATA_BRANCH variable
Diffstat (limited to 'classes')
-rw-r--r--classes/base.bbclass14
1 files changed, 13 insertions, 1 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass
index 7ffb472058..3c6f5a15a1 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -706,6 +706,17 @@ def base_get_scmbasepath(d):
path_to_bbfiles = bb.data.getVar( 'BBFILES', d, 1 ).split()
return path_to_bbfiles[0][:path_to_bbfiles[0].rindex( "packages" )]
+def base_get_metadata_monotone_branch(d):
+ monotone_branch = "<unknown>"
+ try:
+ monotone_branch = file( "%s/_MTN/options" % base_get_scmbasepath(d) ).read().strip()
+ if monotone_branch.startswith( "database" ):
+ monotone_branch_words = monotone_branch.split()
+ monotone_branch = monotone_branch_words[ monotone_branch_words.index( "branch" )+1][1:-1]
+ except:
+ pass
+ return monotone_branch
+
def base_get_metadata_monotone_revision(d):
monotone_revision = "<unknown>"
try:
@@ -725,6 +736,7 @@ def base_get_metadata_svn_revision(d):
pass
return revision
+METADATA_BRANCH ?= "${@base_get_metadata_monotone_branch(d)}"
METADATA_REVISION ?= "${@base_get_metadata_monotone_revision(d)}"
addhandler base_eventhandler
@@ -757,7 +769,7 @@ python base_eventhandler() {
if name.startswith("BuildStarted"):
bb.data.setVar( 'BB_VERSION', bb.__version__, e.data )
- statusvars = ['BB_VERSION', 'METADATA_REVISION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TARGET_FPU']
+ statusvars = ['BB_VERSION', 'METADATA_BRANCH', 'METADATA_REVISION', '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]
statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines)
print statusmsg