summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2019-06-05 16:01:28 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-07 09:11:48 +0100
commitf5dd71ec5289f37661c71db170c0b2d151badd35 (patch)
tree2623fdf070e8b0aabe809ee171a214bcfedebeb4 /meta/classes
parent2b8d484f9623b9e998d642cff44c09dcf4a0b2b8 (diff)
downloadpoky-f5dd71ec5289f37661c71db170c0b2d151badd35.tar.gz
package.bbclass: Clean up writing of runtime pkgdata files
This introduces a variable, PKGDATA_VARS, that contains the names of the variables that are to be output in the runtime pkgdata files. (From OE-Core rev: 43e55bfa040425cf93d94ac626a31f6fd00a7a74) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package.bbclass56
1 files changed, 18 insertions, 38 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 0694855504..20d72bba79 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1349,6 +1349,8 @@ EXPORT_FUNCTIONS package_name_hook
1349 1349
1350PKGDESTWORK = "${WORKDIR}/pkgdata" 1350PKGDESTWORK = "${WORKDIR}/pkgdata"
1351 1351
1352PKGDATA_VARS = "PN PE PV PR PKGE PKGV PKGR LICENSE DESCRIPTION SUMMARY RDEPENDS RPROVIDES RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS SECTION PKG ALLOW_EMPTY FILES CONFFILES FILES_INFO pkg_postinst pkg_postrm pkg_preinst pkg_prerm"
1353
1352python emit_pkgdata() { 1354python emit_pkgdata() {
1353 from glob import glob 1355 from glob import glob
1354 import json 1356 import json
@@ -1453,48 +1455,26 @@ fi
1453 total_size += fstat.st_size 1455 total_size += fstat.st_size
1454 d.setVar('FILES_INFO', json.dumps(files, sort_keys=True)) 1456 d.setVar('FILES_INFO', json.dumps(files, sort_keys=True))
1455 1457
1456 subdata_file = pkgdatadir + "/runtime/%s" % pkg
1457 sf = open(subdata_file, 'w')
1458 write_if_exists(sf, pkg, 'PN')
1459 write_if_exists(sf, pkg, 'PE')
1460 write_if_exists(sf, pkg, 'PV')
1461 write_if_exists(sf, pkg, 'PR')
1462 write_if_exists(sf, pkg, 'PKGE')
1463 write_if_exists(sf, pkg, 'PKGV')
1464 write_if_exists(sf, pkg, 'PKGR')
1465 write_if_exists(sf, pkg, 'LICENSE')
1466 write_if_exists(sf, pkg, 'DESCRIPTION')
1467 write_if_exists(sf, pkg, 'SUMMARY')
1468 write_if_exists(sf, pkg, 'RDEPENDS')
1469 rprov = write_if_exists(sf, pkg, 'RPROVIDES')
1470 write_if_exists(sf, pkg, 'RRECOMMENDS')
1471 write_if_exists(sf, pkg, 'RSUGGESTS')
1472 write_if_exists(sf, pkg, 'RREPLACES')
1473 write_if_exists(sf, pkg, 'RCONFLICTS')
1474 write_if_exists(sf, pkg, 'SECTION')
1475 write_if_exists(sf, pkg, 'PKG')
1476 write_if_exists(sf, pkg, 'ALLOW_EMPTY')
1477 write_if_exists(sf, pkg, 'FILES')
1478 write_if_exists(sf, pkg, 'CONFFILES')
1479 process_postinst_on_target(pkg, d.getVar("MLPREFIX")) 1458 process_postinst_on_target(pkg, d.getVar("MLPREFIX"))
1480 add_set_e_to_scriptlets(pkg) 1459 add_set_e_to_scriptlets(pkg)
1481 write_if_exists(sf, pkg, 'pkg_postinst') 1460
1482 write_if_exists(sf, pkg, 'pkg_postrm') 1461 subdata_file = pkgdatadir + "/runtime/%s" % pkg
1483 write_if_exists(sf, pkg, 'pkg_preinst') 1462 with open(subdata_file, 'w') as sf:
1484 write_if_exists(sf, pkg, 'pkg_prerm') 1463 for var in (d.getVar('PKGDATA_VARS') or "").split():
1485 write_if_exists(sf, pkg, 'FILERPROVIDESFLIST') 1464 val = write_if_exists(sf, pkg, var)
1486 write_if_exists(sf, pkg, 'FILES_INFO') 1465
1487 for dfile in (d.getVar('FILERPROVIDESFLIST_' + pkg) or "").split(): 1466 write_if_exists(sf, pkg, 'FILERPROVIDESFLIST')
1488 write_if_exists(sf, pkg, 'FILERPROVIDES_' + dfile) 1467 for dfile in (d.getVar('FILERPROVIDESFLIST_' + pkg) or "").split():
1489 1468 write_if_exists(sf, pkg, 'FILERPROVIDES_' + dfile)
1490 write_if_exists(sf, pkg, 'FILERDEPENDSFLIST') 1469
1491 for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg) or "").split(): 1470 write_if_exists(sf, pkg, 'FILERDEPENDSFLIST')
1492 write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile) 1471 for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg) or "").split():
1493 1472 write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile)
1494 sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size)) 1473
1495 sf.close() 1474 sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size))
1496 1475
1497 # Symlinks needed for rprovides lookup 1476 # Symlinks needed for rprovides lookup
1477 rprov = d.getVar('RPROVIDES_%s' % pkg) or d.getVar('RPROVIDES')
1498 if rprov: 1478 if rprov:
1499 for p in rprov.strip().split(): 1479 for p in rprov.strip().split():
1500 subdata_sym = pkgdatadir + "/runtime-rprovides/%s/%s" % (p, pkg) 1480 subdata_sym = pkgdatadir + "/runtime-rprovides/%s/%s" % (p, pkg)