Skip to contentSkip to conversation

fix bundled base.bbclass file

PATCH Applied Andrew Stubbs 2 participants 3 messages Jan 14, 2013 – Jan 18, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix bundled base.bbclass file

Hi,

The base.bbclass file that is included with the bitbake sources does not appear to work properly. Specifically, none of the output appears on screen.

A quick look at the poky equivalent shows that they use a different means to print the data. Presumably something got updated somewhere, and the example base class is merely out of date.

The attached patch fixes the do_listtasks and do_showdata code such that it works as I would expect.

I had expected that the base_do_build function would run if my .bb file did not define do_build, but it does not appear to, and it's not obvious to me how, when, or why it is supposed to work.

Andrew

base.bbclass renamed from opt/bitbake/classes/base.bbclass +2 -2
@@ -44,7 +44,7 @@
 	# emit the metadata which isnt valid shell
 	for e in bb.data.keys(d):
 		if d.getVarFlag(e, 'python'):
-			sys.__stdout__.write("\npython %s () {\n%s}\n" % (e, d.getVar(e, True)))
+			bb.plain("\npython %s () {\n%s}" % (e, d.getVar(e, True)))
 }
 
 addtask listtasks
@@ -53,7 +53,7 @@
 	import sys
 	for e in bb.data.keys(d):
 		if d.getVarFlag(e, 'task'):
-			sys.__stdout__.write("%s\n" % e)
+			bb.plain("%s" % e)
 }
 
 addtask build
#1 lore raw
Quoted 10 lines · Andrew Stubbs

Hi,

The base.bbclass file that is included with the bitbake sources does not appear to work properly. Specifically, none of the output appears on screen.

A quick look at the poky equivalent shows that they use a different means to print the data. Presumably something got updated somewhere, and the example base class is merely out of date.

Quoted 6 lines

The attached patch fixes the do_listtasks and do_showdata code such that it works as I would expect.

I had expected that the base_do_build function would run if my .bb file did not define do_build, but it does not appear to, and it's not obvious to me how, when, or why it is supposed to work.

I forgot to add, the env printing still doesn't work, but I don't know how best to fix that? The emit_env method takes a file handle, but stdout and stderr don't work.

Andrew

#2 lore raw
In reply to Andrew Stubbs
Quoted 9 lines · Andrew Stubbs

The base.bbclass file that is included with the bitbake sources does not appear to work properly. Specifically, none of the output appears on screen.

A quick look at the poky equivalent shows that they use a different means to print the data. Presumably something got updated somewhere, and the example base class is merely out of date.

The attached patch fixes the do_listtasks and do_showdata code such that it works as I would expect.

I merged that, thanks.

Quoted 3 lines

I had expected that the base_do_build function would run if my .bb file did not define do_build, but it does not appear to, and it's not obvious to me how, when, or why it is supposed to work.

Your expectation is correct, I'm not sure why that wouldn't happen. The EXPORT_FUNCTIONS do_build should mean do_build gets mapped to base_do_build.

Cheers,

Richard