diff options
| author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2017-09-08 16:33:15 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-11-05 22:39:47 +0000 |
| commit | b085162a8e1c89db16eee5cea54814b0c6f43c3d (patch) | |
| tree | 20a5f04f62c7a4ca0b162a2d6abe2051a5ef370e /scripts | |
| parent | faf109ca946cb2703b06997db1abd6931ed6dcb2 (diff) | |
| download | poky-b085162a8e1c89db16eee5cea54814b0c6f43c3d.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.
(From OE-Core rev: 265db40c75b6a4b9a666e49dd1739423eb711695)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 6255662a4b..677effeef6 100755 --- a/scripts/oe-pkgdata-util +++ b/scripts/oe-pkgdata-util | |||
| @@ -325,8 +325,15 @@ def package_info(args): | |||
| 325 | recipe_version = recipe_version + "-" + mappings[pkg]['PR'] | 325 | recipe_version = recipe_version + "-" + mappings[pkg]['PR'] |
| 326 | pkg_size = mappings[pkg]['PKGSIZE'] | 326 | pkg_size = mappings[pkg]['PKGSIZE'] |
| 327 | 327 | ||
| 328 | items.append("%s %s %s %s %s" % | 328 | line = "%s %s %s %s %s" % (pkg, pkg_version, recipe, recipe_version, pkg_size) |
| 329 | (pkg, pkg_version, recipe, recipe_version, pkg_size)) | 329 | |
| 330 | if args.extra: | ||
| 331 | for var in args.extra: | ||
| 332 | val = mappings[pkg][var].strip() | ||
| 333 | val = re.sub(r'\s+', ' ', val) | ||
| 334 | line += ' "%s"' % val | ||
| 335 | |||
| 336 | items.append(line) | ||
| 330 | print('\n'.join(items)) | 337 | print('\n'.join(items)) |
| 331 | 338 | ||
| 332 | def get_recipe_pkgs(pkgdata_dir, recipe, unpackaged): | 339 | def get_recipe_pkgs(pkgdata_dir, recipe, unpackaged): |
| @@ -530,6 +537,7 @@ def main(): | |||
| 530 | description='Looks up the specified runtime package(s) and display information') | 537 | description='Looks up the specified runtime package(s) and display information') |
| 531 | parser_package_info.add_argument('pkg', nargs='*', help='Runtime package name to look up') | 538 | parser_package_info.add_argument('pkg', nargs='*', help='Runtime package name to look up') |
| 532 | parser_package_info.add_argument('-f', '--file', help='Read package names from the specified file (one per line, first field only)') | 539 | parser_package_info.add_argument('-f', '--file', help='Read package names from the specified file (one per line, first field only)') |
| 540 | parser_package_info.add_argument('-e', '--extra', help='Extra variables to display, e.g., LICENSE (can be specified multiple times)', action='append') | ||
| 533 | parser_package_info.set_defaults(func=package_info) | 541 | parser_package_info.set_defaults(func=package_info) |
| 534 | 542 | ||
| 535 | parser_find_path = subparsers.add_parser('find-path', | 543 | parser_find_path = subparsers.add_parser('find-path', |
