diff options
| author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2018-06-02 21:30:33 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-06-04 15:15:00 +0100 |
| commit | 90a29096f47981e21e86594ca2310b659844c9c1 (patch) | |
| tree | 84637f18948a8f40603471e12773b3752caca100 /scripts/oe-pkgdata-util | |
| parent | 3e9b485ba9d43885c7625f00ba5f42a906832588 (diff) | |
| download | poky-90a29096f47981e21e86594ca2310b659844c9c1.tar.gz | |
oe-pkgdata-util: package-info: Re-add support for the --extra option
Commit 64d3ce83 broke the --extra option.
(From OE-Core rev: cd195bdf5dd2c8ff03c58a63dcabe88b142d2a9c)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-pkgdata-util')
| -rwxr-xr-x | scripts/oe-pkgdata-util | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util index a4e84138d7..e6c9df94e8 100755 --- a/scripts/oe-pkgdata-util +++ b/scripts/oe-pkgdata-util | |||
| @@ -287,8 +287,11 @@ def lookup_recipe(args): | |||
| 287 | def package_info(args): | 287 | def package_info(args): |
| 288 | def parse_pkgdatafile(pkgdatafile): | 288 | def parse_pkgdatafile(pkgdatafile): |
| 289 | vars = ['PKGV', 'PKGE', 'PKGR', 'PN', 'PV', 'PE', 'PR', 'PKGSIZE'] | 289 | vars = ['PKGV', 'PKGE', 'PKGR', 'PN', 'PV', 'PE', 'PR', 'PKGSIZE'] |
| 290 | if args.extra: | ||
| 291 | vars += args.extra | ||
| 290 | with open(pkgdatafile, 'r') as f: | 292 | with open(pkgdatafile, 'r') as f: |
| 291 | vals = dict() | 293 | vals = dict() |
| 294 | extra = '' | ||
| 292 | for line in f: | 295 | for line in f: |
| 293 | for var in vars: | 296 | for var in vars: |
| 294 | m = re.match(var + '(?:_\S+)?:\s*(.+?)\s*$', line) | 297 | m = re.match(var + '(?:_\S+)?:\s*(.+?)\s*$', line) |
| @@ -306,7 +309,12 @@ def package_info(args): | |||
| 306 | recipe_version = vals['PE'] + ":" + recipe_version | 309 | recipe_version = vals['PE'] + ":" + recipe_version |
| 307 | if 'PR' in vals: | 310 | if 'PR' in vals: |
| 308 | recipe_version = recipe_version + "-" + vals['PR'] | 311 | recipe_version = recipe_version + "-" + vals['PR'] |
| 309 | print("%s %s %s %s %s" % (pkg, pkg_version, recipe, recipe_version, pkg_size)) | 312 | if args.extra: |
| 313 | for var in args.extra: | ||
| 314 | if var in vals: | ||
| 315 | val = re.sub(r'\s+', ' ', vals[var]) | ||
| 316 | extra += ' "%s"' % val | ||
| 317 | print("%s %s %s %s %s%s" % (pkg, pkg_version, recipe, recipe_version, pkg_size, extra)) | ||
| 310 | 318 | ||
| 311 | # Handle both multiple arguments and multiple values within an arg (old syntax) | 319 | # Handle both multiple arguments and multiple values within an arg (old syntax) |
| 312 | packages = [] | 320 | packages = [] |
