summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2018-06-02 21:30:32 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-16 10:00:08 +0100
commitc30e400e53dd542646d7178a2fa7814a99e76a82 (patch)
treedf9029ea7fd7653e6b30d9637b7b50768bcd1e79 /scripts
parent12c4bdbfab971357d1fa06096faff0ad92d63006 (diff)
downloadpoky-c30e400e53dd542646d7178a2fa7814a99e76a82.tar.gz
oe-pkgdata-util: Make parse_pkgdatafile() support package suffixed vars
Support for variables suffixed with package names, e.g., PKGV_foo, was removed in commit 3d2c87c4, which broke support for recipes that set other versions on their packages than what is in ${PV}. (From OE-Core rev: 38f8284212370999e1e7b0f6559f7cd786e80d1a) (From OE-Core rev: b750b310afacf298fc450e71d116ed20eef16428) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.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-xscripts/oe-pkgdata-util46
1 files changed, 18 insertions, 28 deletions
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index 5dd9588224..a4e84138d7 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -286,36 +286,26 @@ def lookup_recipe(args):
286 286
287def package_info(args): 287def package_info(args):
288 def parse_pkgdatafile(pkgdatafile): 288 def parse_pkgdatafile(pkgdatafile):
289 vars = ['PKGV', 'PKGE', 'PKGR', 'PN', 'PV', 'PE', 'PR', 'PKGSIZE']
289 with open(pkgdatafile, 'r') as f: 290 with open(pkgdatafile, 'r') as f:
290 pkge = '' 291 vals = dict()
291 pkgr = ''
292 pe = ''
293 pr = ''
294 for line in f: 292 for line in f:
295 if line.startswith('PKGV:'): 293 for var in vars:
296 pkg_version = line.split(':', 1)[1].strip() 294 m = re.match(var + '(?:_\S+)?:\s*(.+?)\s*$', line)
297 elif line.startswith('PKGE:'): 295 if m:
298 pkge = line.split(':', 1)[1].strip() 296 vals[var] = m.group(1)
299 elif line.startswith('PKGR:'): 297 pkg_version = vals['PKGV'] or ''
300 pkgr = line.split(':', 1)[1].strip() 298 recipe = vals['PN'] or ''
301 elif line.startswith('PN:'): 299 recipe_version = vals['PV'] or ''
302 recipe = line.split(':', 1)[1].strip() 300 pkg_size = vals['PKGSIZE'] or ''
303 elif line.startswith('PV:'): 301 if 'PKGE' in vals:
304 recipe_version = line.split(':', 1)[1].strip() 302 pkg_version = vals['PKGE'] + ":" + pkg_version
305 elif line.startswith('PE:'): 303 if 'PKGR' in vals:
306 pe = line.split(':', 1)[1].strip() 304 pkg_version = pkg_version + "-" + vals['PKGR']
307 elif line.startswith('PR:'): 305 if 'PE' in vals:
308 pr = line.split(':', 1)[1].strip() 306 recipe_version = vals['PE'] + ":" + recipe_version
309 elif line.startswith('PKGSIZE'): 307 if 'PR' in vals:
310 pkg_size = line.split(':', 1)[1].strip() 308 recipe_version = recipe_version + "-" + vals['PR']
311 if pkge:
312 pkg_version = pkge + ":" + pkg_version
313 if pkgr:
314 pkg_version = pkg_version + "-" + pkgr
315 if pe:
316 recipe_version = pe + ":" + recipe_version
317 if pr:
318 recipe_version = recipe_version + "-" + pr
319 print("%s %s %s %s %s" % (pkg, pkg_version, recipe, recipe_version, pkg_size)) 309 print("%s %s %s %s %s" % (pkg, pkg_version, recipe, recipe_version, pkg_size))
320 310
321 # Handle both multiple arguments and multiple values within an arg (old syntax) 311 # Handle both multiple arguments and multiple values within an arg (old syntax)