diff options
Diffstat (limited to 'meta/lib/bbconfigbuild/configfragments.py')
-rw-r--r-- | meta/lib/bbconfigbuild/configfragments.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/meta/lib/bbconfigbuild/configfragments.py b/meta/lib/bbconfigbuild/configfragments.py index c1dddc3e4c..61c33ac316 100644 --- a/meta/lib/bbconfigbuild/configfragments.py +++ b/meta/lib/bbconfigbuild/configfragments.py | |||
@@ -62,7 +62,22 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
62 | else: | 62 | else: |
63 | print('Name: {}\nPath: {}\nEnabled: {}\nSummary: {}\nDescription:\n{}\n'.format(f['name'], f['path'], 'yes' if is_enabled else 'no', f['summary'],''.join(f['description']))) | 63 | print('Name: {}\nPath: {}\nEnabled: {}\nSummary: {}\nDescription:\n{}\n'.format(f['name'], f['path'], 'yes' if is_enabled else 'no', f['summary'],''.join(f['description']))) |
64 | 64 | ||
65 | def print_builtin_fragments(builtin, enabled): | ||
66 | print('Available built-in fragments:') | ||
67 | builtin_dict = {i[0]:i[1] for i in [f.split(':') for f in builtin]} | ||
68 | for prefix,var in builtin_dict.items(): | ||
69 | print('{}/...\tSets {} = ...'.format(prefix, var)) | ||
70 | print('') | ||
71 | enabled_builtin_fragments = [f for f in enabled if self.builtin_fragment_exists(f)] | ||
72 | print('Enabled built-in fragments:') | ||
73 | for f in enabled_builtin_fragments: | ||
74 | prefix, value = f.split('/', 1) | ||
75 | print('{}\tSets {} = "{}"'.format(f, builtin_dict[prefix], value)) | ||
76 | print('') | ||
77 | |||
65 | all_enabled_fragments = (self.tinfoil.config_data.getVar('OE_FRAGMENTS') or "").split() | 78 | all_enabled_fragments = (self.tinfoil.config_data.getVar('OE_FRAGMENTS') or "").split() |
79 | all_builtin_fragments = (self.tinfoil.config_data.getVar('OE_FRAGMENTS_BUILTIN') or "").split() | ||
80 | print_builtin_fragments(all_builtin_fragments, all_enabled_fragments) | ||
66 | 81 | ||
67 | for layername, layerdata in self.discover_fragments().items(): | 82 | for layername, layerdata in self.discover_fragments().items(): |
68 | layerdir = layerdata['layerdir'] | 83 | layerdir = layerdata['layerdir'] |
@@ -89,6 +104,11 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
89 | return True | 104 | return True |
90 | return False | 105 | return False |
91 | 106 | ||
107 | def builtin_fragment_exists(self, fragmentname): | ||
108 | fragment_prefix = fragmentname.split("/",1)[0] | ||
109 | fragment_prefix_defs = set([f.split(':')[0] for f in self.tinfoil.config_data.getVar('OE_FRAGMENTS_BUILTIN').split()]) | ||
110 | return fragment_prefix in fragment_prefix_defs | ||
111 | |||
92 | def create_conf(self, confpath): | 112 | def create_conf(self, confpath): |
93 | if not os.path.exists(confpath): | 113 | if not os.path.exists(confpath): |
94 | with open(confpath, 'w') as f: | 114 | with open(confpath, 'w') as f: |
@@ -112,7 +132,7 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
112 | return " ".join(enabled_fragments), None, 0, True | 132 | return " ".join(enabled_fragments), None, 0, True |
113 | 133 | ||
114 | for f in args.fragmentname: | 134 | for f in args.fragmentname: |
115 | if not self.fragment_exists(f): | 135 | if not self.fragment_exists(f) and not self.builtin_fragment_exists(f): |
116 | raise Exception("Fragment {} does not exist; use 'list-fragments' to see the full list.".format(f)) | 136 | raise Exception("Fragment {} does not exist; use 'list-fragments' to see the full list.".format(f)) |
117 | 137 | ||
118 | self.create_conf(args.confpath) | 138 | self.create_conf(args.confpath) |