[OE-core] [PATCH 1/1] base.bbclass: show layer's branches/revisions in the banner info

Koen Kooi koen at dominion.thruhere.net
Tue Jun 28 15:13:35 UTC 2011


Op 28 jun 2011, om 16:27 heeft Mark Hatle het volgende geschreven:

> On 6/28/11 1:45 AM, Koen Kooi wrote:
>> 
>> Op 28 jun 2011, om 07:37 heeft Dexuan Cui het volgende geschreven:
>> 
>>> Signed-off-by: Dexuan Cui <dexuan.cui at intel.com>
>>> ---
>>> meta/classes/base.bbclass |   14 +++++++++++++-
>>> 1 files changed, 13 insertions(+), 1 deletions(-)
>>> 
>>> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
>>> index 119b052..4766c77 100644
>>> --- a/meta/classes/base.bbclass
>>> +++ b/meta/classes/base.bbclass
>>> @@ -165,9 +165,21 @@ python base_eventhandler() {
>>> 			note(msg)
>>> 
>>> 	if name.startswith("BuildStarted"):
>>> +		corebase = data.getVar("COREBASE", e.data, 1)
>>> +		corelayers = [corebase + "/meta", corebase + "/meta-yocto"]
>>> +		layers = (data.getVar("BBLAYERS", e.data, 1) or "").split()
>>> +		layers = [i for i in layers if i not in corelayers]
>>> +		fmt_str = "%-27s = \"%s\""
>>> +		layer_branches = [fmt_str % (os.path.basename(i)+"_BRANCH", \
>>> +			base_get_metadata_git_branch(i, None).strip()) for i in layers]
>>> +		layer_revisions = [fmt_str % (os.path.basename(i)+"_REVISION", \
>>> +			base_get_metadata_git_revision(i, None)) for i in layers]
>>> 		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']
>>> -		statuslines = ["%-17s = \"%s\"" % (i, bb.data.getVar(i, e.data, 1) or '') for i in statusvars]
>>> +		statuslines = [fmt_str % (i, bb.data.getVar(i, e.data, 1) or '') for i in statusvars]
>>> +		for i in range(len(layer_branches)):
>>> +			statuslines.insert(3+2*i, layer_branches[i])
>>> +			statuslines.insert(3+2*i+1, layer_revisions[i])
>>> 		statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines)
>>> 		print statusmsg
>> 
>> I tried this patch and I get:
>> 
>> OE Build Configuration:
>> BB_VERSION                  = "1.13.1"
>> METADATA_BRANCH             = "master"
>> METADATA_REVISION           = "364ca0d2d0399c8cc6d3b3fc28308e1e14673544"
>> meta-angstrom_BRANCH        = "master"
>> meta-angstrom_REVISION      = "c19c342c62416752117c2dce4696840bc864f647"
> ...
>> TARGET_ARCH                 = "arm"
>> TARGET_OS                   = "linux-gnueabi"
>> MACHINE                     = "beagleboard"
>> DISTRO                      = "angstrom"
>> DISTRO_VERSION              = "v2011.06-core"
>> TARGET_FPU                  = "hard"
>> 
>> So it works as expected, but the output is a bit confusing. I have a few (conflicting) suggestions:
>> 
>> 1) replace _BRANCH and _REVISION with ' branch' and ' revision', e.g.:
>> 
>> 	meta-archos branch          = "master"
>> 	meta-archos revision        = "413933fb5f62574e38a9a1e38905ba6e9c1be4ad"
>> 
>> 2) for the extra layers put branch and revision on a single line:
>> 
>> 	meta-archos          = "master/413933fb5f62574e38a9a1e38905ba6e9c1be4ad"
>> 
>> 3) Move the revision info down, e..g
>> 
>> OE Build Configuration:
>> BB_VERSION                  = "1.13.1"
>> TARGET_ARCH                 = "arm"
>> TARGET_OS                   = "linux-gnueabi"
>> MACHINE                     = "beagleboard"
>> DISTRO                      = "angstrom"
>> DISTRO_VERSION              = "v2011.06-core"
>> TARGET_FPU                  = "hard"
>> METADATA_BRANCH             = "master"
>> METADATA_REVISION           = "364ca0d2d0399c8cc6d3b3fc28308e1e14673544"
>> meta-angstrom_BRANCH        = "master"
>> meta-angstrom_REVISION      = "c19c342c62416752117c2dce4696840bc864f647"
>> 
>> etc.
>> 
>> What do you think about that?
> 
> I think my preference is either 3 or a combination of 2 & 3.
> 
> To me the important bits are the configuration settings, followed by the
> components that are being used as a secondary concern.  It will all help in
> debugging and issue, but if the target/distro isn't correct then it doesn't
> matter what the rest is.

The current patch outputs the following:

OE Build Configuration:
BB_VERSION                  = "1.13.2"
TARGET_ARCH                 = "arm"
TARGET_OS                   = "linux-gnueabi"
MACHINE                     = "beagleboard"
DISTRO                      = "angstrom"
DISTRO_VERSION              = "v2011.06-core"
TARGET_FPU                  = "hard"
METADATA_BRANCH             = "master"
METADATA_REVISION           = "f1c2bfb82e0d11955cb8dc6b2f7aca9e291e1269"
meta-angstrom               = "master:a3bb1d65ae008b32a20701f479dea59e8268f806"
meta-oe                     = "master:8a12ecca32766ecdceb72cae76e93f8aadcf3669"
meta-efl                    = "master:8a12ecca32766ecdceb72cae76e93f8aadcf3669"
meta-gpe                    = "master:8a12ecca32766ecdceb72cae76e93f8aadcf3669"
meta-gnome                  = "master:8a12ecca32766ecdceb72cae76e93f8aadcf3669"
meta-texasinstruments       = "master:2e16e2fbd93bc00bc0a0afaf86975da7778eaa43"
meta-efikamx                = "master:70cff8742d629fd32463e3ef1bddb83f04d08dc5"
meta-nslu2                  = "master:aaf918b85d7a8155d6e7c0ff042808346998fbea"
meta-htc                    = "master:f37d05ca7450f85642cea0e43a75df10663bd8f6"
meta-nokia                  = "master:f37d05ca7450f85642cea0e43a75df10663bd8f6"
meta-openmoko               = "master:f37d05ca7450f85642cea0e43a75df10663bd8f6"
meta-palm                   = "master:f37d05ca7450f85642cea0e43a75df10663bd8f6"
meta-zaurus                 = "master:f37d05ca7450f85642cea0e43a75df10663bd8f6"
meta-sugarbay               = "master:50661bf038a34702f3aa139c3ea0d67fbb0ce5db"
meta-crownbay               = "master:50661bf038a34702f3aa139c3ea0d67fbb0ce5db"
meta-emenlow                = "master:50661bf038a34702f3aa139c3ea0d67fbb0ce5db"
meta-fishriver              = "master:50661bf038a34702f3aa139c3ea0d67fbb0ce5db"
meta-jasperforest           = "master:50661bf038a34702f3aa139c3ea0d67fbb0ce5db"
meta-n450                   = "master:50661bf038a34702f3aa139c3ea0d67fbb0ce5db"
meta-ettus                  = "master:c34c30fa29f7ab484cc90efb9713325da8e01460"
meta-openpandora            = "master:edaf6e751f873ed7a82c1116d3d58b9a070052dc"
meta-archos                 = "master:413933fb5f62574e38a9a1e38905ba6e9c1be4ad"

Still a mouthfull, but easy to digest IMO



More information about the Openembedded-core mailing list