oe-pkgdata-util: package-info: Allow extra variables to be displayed
PATCH v2 1/1 oe-pkgdata-util: package-info: Allow extra variables to be displayed
From: Peter Kjellerstedt <[email protected]>
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.
---
This is a backport of the corresponding change (6f054fcf) on master. It should not change anything unless one actually uses the --extra option to oe-pkgdata-util.
PATCHv2: Now without Change-Id footer.
scripts/oe-pkgdata-util | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
scripts/oe-pkgdata-util +10 -2
@@ -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',
Signature · 1 line
2.12.0
Is there any chance of this making it into 2.3.2? It seems 2.3.2 is not too far away, given that the DISTRO_VERSION has been updated to 2.3.2 on the pyro branch, but I do not know what the current status is or when you expect to cut the release.
For the record this should be safe to take regarding any QA testing done since it only affects a script that is not used as part of building anything, and then only changes its behavior if a new argument is specified.
Quoted 70 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Peter Kjellerstedt
Sent: den 8 september 2017 16:33
To: Armin Kuster <[email protected]>; openembedded- [email protected]
Subject: [OE-core] [pyro][PATCHv2] oe-pkgdata-util: package-info: Allow extra variables to be displayedFrom: Peter Kjellerstedt <[email protected]>
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 <[email protected]>Signed-off-by Ross Burton <[email protected]>Signed-off-by Richard Purdie <[email protected]>---
This is a backport of the corresponding change (
6f054fcf) on master. It should not change anything unless one actually uses the --extra option to oe-pkgdata-util.PATCHv2: Now without Change-Id footer.
scripts/oe-pkgdata-util | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)scripts/oe-pkgdata-util +0
-0@@ -325,8 +325,15 @@ def package_info(args): recipe_version = recipe_version + "-" +mappings[pkg]['PR']
pkg_size= mappings[pkg]['PKGSIZE']scripts/oe-pkgdata-util +0
-2- 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)scripts/oe-pkgdata-util +8
-0+ + 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='Readpackage 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)
Quoted 3 lines
parser_find_path= subparsers.add_parser('find-path',
--
2.12.0
//Peter
Peter
Quoted 1 line · Peter Kjellerstedt
Is there any chance of this making it into 2.3.2?
2.3.2 is in QA so it may not. This does not mean it wont end up in morty.
I am stagging the change now.
thanks for the reminder.
Armin
Quoted 84 lines
It seems 2.3.2 is
not too far away, given that theDISTRO_VERSIONhas been updated to 2.3.2 on the pyro branch, but I do not know what the current status is or when you expect to cut the release.For the record this should be safe to take regarding any QA testing done since it only affects a script that is not used as part of building anything, and then only changes its behavior if a new argument is specified.
Quoted 70 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Peter Kjellerstedt
Sent: den 8 september 2017 16:33
To: Armin Kuster <[email protected]>; openembedded- [email protected]
Subject: [OE-core] [pyro][PATCHv2] oe-pkgdata-util: package-info: Allow extra variables to be displayedFrom: Peter Kjellerstedt <[email protected]>
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 <[email protected]>Signed-off-by Ross Burton <[email protected]>Signed-off-by Richard Purdie <[email protected]>---
This is a backport of the corresponding change (
6f054fcf) on master. It should not change anything unless one actually uses the --extra option to oe-pkgdata-util.PATCHv2: Now without Change-Id footer.
scripts/oe-pkgdata-util | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)scripts/oe-pkgdata-util +0
-0@@ -325,8 +325,15 @@ def package_info(args): recipe_version = recipe_version + "-" +mappings[pkg]['PR']
pkg_size= mappings[pkg]['PKGSIZE']scripts/oe-pkgdata-util +0
-2- 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)scripts/oe-pkgdata-util +8
-0+ + 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='Readpackage 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)Quoted 3 lines
parser_find_path= subparsers.add_parser('find-path',
--
2.12.0//Peter