summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-10-30 10:22:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-03 17:40:41 +0000
commit8ec6308bc3268779d305ba18c36e7bff37933e96 (patch)
tree02185949a5a97c5e70f1e0bb8aa7dfe5a170f0c7
parent4a6a9e2bc504015ab6abb1afafe78a1f6ee36af9 (diff)
downloadpoky-8ec6308bc3268779d305ba18c36e7bff37933e96.tar.gz
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>
-rw-r--r--meta/lib/bbconfigbuild/configfragments.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/lib/bbconfigbuild/configfragments.py b/meta/lib/bbconfigbuild/configfragments.py
index 60cdced555..59e760f290 100644
--- a/meta/lib/bbconfigbuild/configfragments.py
+++ b/meta/lib/bbconfigbuild/configfragments.py
@@ -97,12 +97,12 @@ class ConfigFragmentsPlugin(LayerPlugin):
97 print_fragment(f, args.verbose, is_enabled=False) 97 print_fragment(f, args.verbose, is_enabled=False)
98 print('') 98 print('')
99 99
100 def fragment_exists(self, fragmentname, fragments): 100 def get_fragment(self, fragmentname, fragments):
101 for layername, layerdata in fragments.items(): 101 for layername, layerdata in fragments.items():
102 for f in layerdata['fragments']: 102 for f in layerdata['fragments']:
103 if f['name'] == fragmentname: 103 if f['name'] == fragmentname:
104 return True 104 return f
105 return False 105 return None
106 106
107 def fragment_prefix(self, fragmentname): 107 def fragment_prefix(self, fragmentname):
108 return fragmentname.split("/",1)[0] 108 return fragmentname.split("/",1)[0]
@@ -138,7 +138,7 @@ class ConfigFragmentsPlugin(LayerPlugin):
138 138
139 fragments = self.discover_fragments() 139 fragments = self.discover_fragments()
140 for f in args.fragmentname: 140 for f in args.fragmentname:
141 if not self.fragment_exists(f, fragments) and not self.builtin_fragment_exists(f): 141 if not self.get_fragment(f, fragments) and not self.builtin_fragment_exists(f):
142 raise Exception("Fragment {} does not exist; use 'list-fragments' to see the full list.".format(f)) 142 raise Exception("Fragment {} does not exist; use 'list-fragments' to see the full list.".format(f))
143 143
144 self.create_conf(args.confpath) 144 self.create_conf(args.confpath)