diff options
| author | Alexander Kanavin <alex@linutronix.de> | 2025-10-30 10:22:43 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-03 17:40:41 +0000 |
| commit | 4a6a9e2bc504015ab6abb1afafe78a1f6ee36af9 (patch) | |
| tree | adacdc67a8c72122435dabd32a16afac904060aa | |
| parent | 2ef4c3ac941ee41894ccdec59a5cbe7c7e677b86 (diff) | |
| download | poky-4a6a9e2bc504015ab6abb1afafe78a1f6ee36af9.tar.gz | |
bbconfigbuild/configfragments.py: run discover_fragments() only once when enabling them
(From OE-Core rev: f2d9519fc3aa74996654bf02d31fb6496d7a05f3)
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.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/lib/bbconfigbuild/configfragments.py b/meta/lib/bbconfigbuild/configfragments.py index 21baedc9a4..60cdced555 100644 --- a/meta/lib/bbconfigbuild/configfragments.py +++ b/meta/lib/bbconfigbuild/configfragments.py | |||
| @@ -97,8 +97,8 @@ 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): | 100 | def fragment_exists(self, fragmentname, fragments): |
| 101 | for layername, layerdata in self.discover_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 True |
| @@ -136,8 +136,9 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
| 136 | enabled_fragments.append(f) | 136 | enabled_fragments.append(f) |
| 137 | return " ".join(enabled_fragments), None, 0, True | 137 | return " ".join(enabled_fragments), None, 0, True |
| 138 | 138 | ||
| 139 | fragments = self.discover_fragments() | ||
| 139 | for f in args.fragmentname: | 140 | for f in args.fragmentname: |
| 140 | if not self.fragment_exists(f) and not self.builtin_fragment_exists(f): | 141 | if not self.fragment_exists(f, fragments) and not self.builtin_fragment_exists(f): |
| 141 | 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)) |
| 142 | 143 | ||
| 143 | self.create_conf(args.confpath) | 144 | self.create_conf(args.confpath) |
