mirror of
git://git.yoctoproject.org/poky
synced 2026-04-02 02:49:11 +00:00
bbconfigbuild/configfragments.py: replace fragment_exists() with a more generic get_fragment()
This can be used to get fragment information by its name (or None, if there's no fragment), rather than just check for its existence. (From OE-Core rev: 2ac6f564c26f2f26a003b4f0e344ae8e803e2140) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
4a6a9e2bc5
commit
8ec6308bc3
@ -97,12 +97,12 @@ class ConfigFragmentsPlugin(LayerPlugin):
|
|||||||
print_fragment(f, args.verbose, is_enabled=False)
|
print_fragment(f, args.verbose, is_enabled=False)
|
||||||
print('')
|
print('')
|
||||||
|
|
||||||
def fragment_exists(self, fragmentname, fragments):
|
def get_fragment(self, fragmentname, fragments):
|
||||||
for layername, layerdata in fragments.items():
|
for layername, layerdata in fragments.items():
|
||||||
for f in layerdata['fragments']:
|
for f in layerdata['fragments']:
|
||||||
if f['name'] == fragmentname:
|
if f['name'] == fragmentname:
|
||||||
return True
|
return f
|
||||||
return False
|
return None
|
||||||
|
|
||||||
def fragment_prefix(self, fragmentname):
|
def fragment_prefix(self, fragmentname):
|
||||||
return fragmentname.split("/",1)[0]
|
return fragmentname.split("/",1)[0]
|
||||||
@ -138,7 +138,7 @@ class ConfigFragmentsPlugin(LayerPlugin):
|
|||||||
|
|
||||||
fragments = self.discover_fragments()
|
fragments = self.discover_fragments()
|
||||||
for f in args.fragmentname:
|
for f in args.fragmentname:
|
||||||
if not self.fragment_exists(f, fragments) and not self.builtin_fragment_exists(f):
|
if not self.get_fragment(f, fragments) and not self.builtin_fragment_exists(f):
|
||||||
raise Exception("Fragment {} does not exist; use 'list-fragments' to see the full list.".format(f))
|
raise Exception("Fragment {} does not exist; use 'list-fragments' to see the full list.".format(f))
|
||||||
|
|
||||||
self.create_conf(args.confpath)
|
self.create_conf(args.confpath)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user