summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-02-15 15:23:45 +0000
committerRichard Purdie <richard@openedhand.com>2008-02-15 15:23:45 +0000
commit35d364f96478a6f1a264f5c49aded46702615795 (patch)
tree433a6a2d9c63943a98c08f4a93614cdc31893a63 /meta/classes
parent53e5a894bba2ebbe668aca1c8f0055e0de4b4fd0 (diff)
downloadpoky-35d364f96478a6f1a264f5c49aded46702615795.tar.gz
base.bbclass: Show svn revision of poky being used
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3818 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/base.bbclass40
1 files changed, 28 insertions, 12 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 8d92e3db06..a3a795eb9c 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -603,6 +603,31 @@ python base_do_unpack() {
603 raise bb.build.FuncFailed() 603 raise bb.build.FuncFailed()
604} 604}
605 605
606def base_get_scmbasepath(d):
607 import bb
608 path_to_bbfiles = bb.data.getVar( 'BBFILES', d, 1 ).split()
609 return path_to_bbfiles[0][:path_to_bbfiles[0].rindex( "packages" )]
610
611def base_get_metadata_monotone_revision(d):
612 monotone_revision = "<unknown>"
613 try:
614 monotone_revision = file( "%s/_MTN/revision" % base_get_scmbasepath(d) ).read().strip()
615 if monotone_revision.startswith( "format_version" ):
616 monotone_revision_words = monotone_revision.split()
617 monotone_revision = monotone_revision_words[ monotone_revision_words.index( "old_revision" )+1][1:-1]
618 except IOError:
619 pass
620 return monotone_revision
621
622def base_get_metadata_svn_revision(d):
623 revision = "<unknown>"
624 try:
625 revision = file( "%s/.svn/entries" % base_get_scmbasepath(d) ).readlines()[3].strip()
626 except IOError:
627 pass
628 return revision
629
630METADATA_REVISION_FUNCTION ?= "${@base_get_metadata_monotone_revision(d)}"
606 631
607addhandler base_eventhandler 632addhandler base_eventhandler
608python base_eventhandler() { 633python base_eventhandler() {
@@ -634,18 +659,9 @@ python base_eventhandler() {
634 659
635 if name.startswith("BuildStarted"): 660 if name.startswith("BuildStarted"):
636 bb.data.setVar( 'BB_VERSION', bb.__version__, e.data ) 661 bb.data.setVar( 'BB_VERSION', bb.__version__, e.data )
637 path_to_bbfiles = bb.data.getVar( 'BBFILES', e.data, 1 ) 662 revision = bb.data.getVar('METADATA_REVISION_FUNCTION', e.data, 1)
638 path_to_packages = path_to_bbfiles[:path_to_bbfiles.rindex( "packages" )] 663 bb.data.setVar( 'METADATA_REVISION', revision, e.data )
639 monotone_revision = "<unknown>" 664 statusvars = ['BB_VERSION', 'METADATA_REVISION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TARGET_FPU']
640 try:
641 monotone_revision = file( "%s/_MTN/revision" % path_to_packages ).read().strip()
642 if monotone_revision.startswith( "format_version" ):
643 monotone_revision_words = monotone_revision.split()
644 monotone_revision = monotone_revision_words[ monotone_revision_words.index( "old_revision" )+1][1:-1]
645 except IOError:
646 pass
647 bb.data.setVar( 'OE_REVISION', monotone_revision, e.data )
648 statusvars = ['BB_VERSION', 'OE_REVISION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TARGET_FPU']
649 statuslines = ["%-14s = \"%s\"" % (i, bb.data.getVar(i, e.data, 1) or '') for i in statusvars] 665 statuslines = ["%-14s = \"%s\"" % (i, bb.data.getVar(i, e.data, 1) or '') for i in statusvars]
650 statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines) 666 statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines)
651 print statusmsg 667 print statusmsg