diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2017-07-03 12:14:59 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-06 14:38:07 +0100 |
commit | 6f054fcf08f6d5aeb6b5ade74ac5cc61a99fb8fe (patch) | |
tree | e0acbc5f4f8cf6cb8a186ea6ed74af596d54a7c6 /scripts | |
parent | 7e880775e2e354c76c386c91b2b8f36eddf1574d (diff) | |
download | openembedded-core-contrib-6f054fcf08f6d5aeb6b5ade74ac5cc61a99fb8fe.tar.gz |
oe-pkgdata-util: package-info: Allow extra variables to be displayed
By specifying the -e <var> option one or multiple times, extra
variables available in the pkgdata can be displayed, e.,g,
`oe-pkgdata-util package-info -e SUMMARY -e LICENSE ...`. The extra
variables displayed are quoted since some of them may contain
whitespace.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/oe-pkgdata-util | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util index 6255662a4b5..677effeef6e 100755 --- a/scripts/oe-pkgdata-util +++ b/scripts/oe-pkgdata-util @@ -325,8 +325,15 @@ def package_info(args): recipe_version = recipe_version + "-" + mappings[pkg]['PR'] pkg_size = mappings[pkg]['PKGSIZE'] - items.append("%s %s %s %s %s" % - (pkg, pkg_version, recipe, recipe_version, pkg_size)) + line = "%s %s %s %s %s" % (pkg, pkg_version, recipe, recipe_version, pkg_size) + + if args.extra: + for var in args.extra: + val = mappings[pkg][var].strip() + val = re.sub(r'\s+', ' ', val) + line += ' "%s"' % val + + items.append(line) print('\n'.join(items)) def get_recipe_pkgs(pkgdata_dir, recipe, unpackaged): @@ -530,6 +537,7 @@ def main(): description='Looks up the specified runtime package(s) and display information') parser_package_info.add_argument('pkg', nargs='*', help='Runtime package name to look up') parser_package_info.add_argument('-f', '--file', help='Read package names from the specified file (one per line, first field only)') + parser_package_info.add_argument('-e', '--extra', help='Extra variables to display, e.g., LICENSE (can be specified multiple times)', action='append') parser_package_info.set_defaults(func=package_info) parser_find_path = subparsers.add_parser('find-path', |