diff options
| -rw-r--r-- | meta/lib/bbconfigbuild/configfragments.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/lib/bbconfigbuild/configfragments.py b/meta/lib/bbconfigbuild/configfragments.py index 61c33ac316..fce3301bac 100644 --- a/meta/lib/bbconfigbuild/configfragments.py +++ b/meta/lib/bbconfigbuild/configfragments.py | |||
| @@ -156,6 +156,18 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
| 156 | if modified: | 156 | if modified: |
| 157 | print("Fragment {} removed from {}.".format(", ".join(args.fragmentname), args.confpath)) | 157 | print("Fragment {} removed from {}.".format(", ".join(args.fragmentname), args.confpath)) |
| 158 | 158 | ||
| 159 | def do_show_fragment(self, args): | ||
| 160 | """ Show the content of a fragment """ | ||
| 161 | for layername, layerdata in self.discover_fragments().items(): | ||
| 162 | fragments = layerdata['fragments'] | ||
| 163 | for fragment in fragments: | ||
| 164 | if fragment['name'] == args.fragmentname: | ||
| 165 | print(f"{fragment['path']}:") | ||
| 166 | print() | ||
| 167 | with open(fragment['path']) as fd: | ||
| 168 | print(fd.read()) | ||
| 169 | return | ||
| 170 | |||
| 159 | def do_disable_all_fragments(self, args): | 171 | def do_disable_all_fragments(self, args): |
| 160 | """ Disable all fragments in the local build configuration """ | 172 | """ Disable all fragments in the local build configuration """ |
| 161 | def disable_all_helper(varname, origvalue, op, newlines): | 173 | def disable_all_helper(varname, origvalue, op, newlines): |
| @@ -181,5 +193,8 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
| 181 | parser_disable_fragment.add_argument("--confpath", default=default_confpath, help='Configuration file which contains a list of enabled fragments (default is {}).'.format(default_confpath)) | 193 | parser_disable_fragment.add_argument("--confpath", default=default_confpath, help='Configuration file which contains a list of enabled fragments (default is {}).'.format(default_confpath)) |
| 182 | parser_disable_fragment.add_argument('fragmentname', help='The name of the fragment', nargs='+') | 194 | parser_disable_fragment.add_argument('fragmentname', help='The name of the fragment', nargs='+') |
| 183 | 195 | ||
| 196 | parser_show_fragment = self.add_command(sp, 'show-fragment', self.do_show_fragment, parserecipes=False) | ||
| 197 | parser_show_fragment.add_argument('fragmentname', help='The name of the fragment') | ||
| 198 | |||
| 184 | parser_disable_all = self.add_command(sp, 'disable-all-fragments', self.do_disable_all_fragments, parserecipes=False) | 199 | parser_disable_all = self.add_command(sp, 'disable-all-fragments', self.do_disable_all_fragments, parserecipes=False) |
| 185 | parser_disable_all.add_argument("--confpath", default=default_confpath, help='Configuration file which contains a list of enabled fragments (default is {}).'.format(default_confpath)) | 200 | parser_disable_all.add_argument("--confpath", default=default_confpath, help='Configuration file which contains a list of enabled fragments (default is {}).'.format(default_confpath)) |
