From: Alexander Kanavin Date: Thu, 30 Oct 2025 09:22:43 +0000 (+0100) Subject: bbconfigbuild/configfragments.py: run discover_fragments() only once when enabling... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2d9519fc3aa74996654bf02d31fb6496d7a05f3;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git bbconfigbuild/configfragments.py: run discover_fragments() only once when enabling them Signed-off-by: Alexander Kanavin Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/lib/bbconfigbuild/configfragments.py b/meta/lib/bbconfigbuild/configfragments.py index 21baedc9a42..60cdced555c 100644 --- a/meta/lib/bbconfigbuild/configfragments.py +++ b/meta/lib/bbconfigbuild/configfragments.py @@ -97,8 +97,8 @@ class ConfigFragmentsPlugin(LayerPlugin): print_fragment(f, args.verbose, is_enabled=False) print('') - def fragment_exists(self, fragmentname): - for layername, layerdata in self.discover_fragments().items(): + def fragment_exists(self, fragmentname, fragments): + for layername, layerdata in fragments.items(): for f in layerdata['fragments']: if f['name'] == fragmentname: return True @@ -136,8 +136,9 @@ class ConfigFragmentsPlugin(LayerPlugin): enabled_fragments.append(f) return " ".join(enabled_fragments), None, 0, True + fragments = self.discover_fragments() for f in args.fragmentname: - if not self.fragment_exists(f) and not self.builtin_fragment_exists(f): + if not self.fragment_exists(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)) self.create_conf(args.confpath)