Bug 7723 - Needed a way to identify layer name in bbclass to be able to filter out packages in specific layer.
Summary: Needed a way to identify layer name in bbclass to be able to filter out packa...
Status: VERIFIED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 1.9
Hardware: Other Multiple
: Medium+ enhancement
Target Milestone: 1.9 M1
Assignee: Paul Eggleton
QA Contact: Costin
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-05-06 15:22 UTC by Alexander Kanevskiy
Modified: 2015-06-16 02:53 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kanevskiy 2015-05-06 15:22:10 UTC
At the moment there is blacklist.bbclass implementation that is able to filter out recipe on global level. It would be good to have ability to filter recipe name or pattern of recipes if they are coming from specific layer. Or another example to implement layer specific "whitelist" of recipes to be used. 
For both of those, there is need to expose variable(s) that would be pointing beside $FILE or $PN from which layer name/path it's actually coming from.
Comment 1 Paul Eggleton 2015-05-06 16:11:12 UTC
I've pushed a branch with a patch that adds a function to bb.utils which does this:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=paule/stuff
Comment 2 Paul Eggleton 2015-05-18 15:51:11 UTC
Patch sent for review:
http://patchwork.openembedded.org/patch/93813/
Comment 3 Alexander Kanevskiy 2015-05-18 16:07:05 UTC
BTW, once it's get implemented, it would be good to also include in 1.8.x maintenance releases.
Comment 4 Paul Eggleton 2015-05-22 15:43:35 UTC
Sure, I've just sent a backport to bitbake 1.26, which will feed into the fido branch in poky when merged.
Comment 5 Paul Eggleton 2015-05-27 09:12:48 UTC
Now in the fido branch as well:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=fido&id=ca6ef30c7a33b3860d9b0d0da51d9b8786073170

Marking as resolved.
Comment 6 Costin 2015-06-16 02:53:02 UTC
Hello,

Checked this feature and it works.
Steps performed to test it:

1)vi meta/recipes-tests/teste/teste_1.0.0.bb

SUMARY = "test recipe"

LICENSE = "CLOSED"

python do_mytask(){
  bb.note("running mytest")
  result = bb.utils.get_file_layer("/media/cosscat/Touro/5poky/meta/recipes-devtools/m4/m4_1.4.17.bb",d)
  bb.note(result)
}

addtask do_mytask before do_build

2) bitbake teste
3) cat log.do_mytask
DEBUG: Executing python function do_mytask
NOTE: running mytest
NOTE: core
DEBUG: Python function do_mytask finished 

Marking as verified.

Costin