diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/base.bbclass | 14 |
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 |