From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCHv2 2/2] oe-pkgdata-util: package-info: Re-add support for the --extra option
Date: Sat, 2 Jun 2018 21:30:33 +0200 [thread overview]
Message-ID: <20180602193033.14641-2-pkj@axis.com> (raw)
In-Reply-To: <20180602193033.14641-1-pkj@axis.com>
Commit 64d3ce83 broke the --extra option.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
scripts/oe-pkgdata-util | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index 965f473725..bd12047ea5 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -287,8 +287,11 @@ def lookup_recipe(args):
def package_info(args):
def parse_pkgdatafile(pkgdatafile):
vars = ['PKGV', 'PKGE', 'PKGR', 'PN', 'PV', 'PE', 'PR', 'PKGSIZE']
+ if args.extra:
+ vars += args.extra
with open(pkgdatafile, 'r') as f:
vals = dict()
+ extra = ''
for line in f:
for var in vars:
m = re.match(var + '(?:_\S+)?:\s*(.+?)\s*$', line)
@@ -306,7 +309,12 @@ def package_info(args):
recipe_version = vals['PE'] + ":" + recipe_version
if 'PR' in vals:
recipe_version = recipe_version + "-" + vals['PR']
- print("%s %s %s %s %s" % (pkg, pkg_version, recipe, recipe_version, pkg_size))
+ if args.extra:
+ for var in args.extra:
+ if var in vals:
+ val = re.sub(r'\s+', ' ', vals[var])
+ extra += ' "%s"' % val
+ print("%s %s %s %s %s%s" % (pkg, pkg_version, recipe, recipe_version, pkg_size, extra))
# Handle both multiple arguments and multiple values within an arg (old syntax)
packages = []
--
2.12.0
next prev parent reply other threads:[~2018-06-02 19:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-02 19:30 [PATCHv2 1/2] oe-pkgdata-util: Make parse_pkgdatafile() support package suffixed vars Peter Kjellerstedt
2018-06-02 19:30 ` Peter Kjellerstedt [this message]
2018-06-03 16:14 ` Richard Purdie
2018-06-04 7:37 ` Peter Kjellerstedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180602193033.14641-2-pkj@axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox