diff options
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r-- | meta/classes/package.bbclass | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 15bff9c778..49d30caef7 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -1140,6 +1140,14 @@ python split_and_strip_files () { | |||
1140 | # Modified the file so clear the cache | 1140 | # Modified the file so clear the cache |
1141 | cpath.updatecache(file) | 1141 | cpath.updatecache(file) |
1142 | 1142 | ||
1143 | def strip_pkgd_prefix(f): | ||
1144 | nonlocal dvar | ||
1145 | |||
1146 | if f.startswith(dvar): | ||
1147 | return f[len(dvar):] | ||
1148 | |||
1149 | return f | ||
1150 | |||
1143 | # | 1151 | # |
1144 | # First lets process debug splitting | 1152 | # First lets process debug splitting |
1145 | # | 1153 | # |
@@ -1153,6 +1161,8 @@ python split_and_strip_files () { | |||
1153 | for file in staticlibs: | 1161 | for file in staticlibs: |
1154 | results.append( (file,source_info(file, d)) ) | 1162 | results.append( (file,source_info(file, d)) ) |
1155 | 1163 | ||
1164 | d.setVar("PKGDEBUGSOURCES", {strip_pkgd_prefix(f): sorted(s) for f, s in results}) | ||
1165 | |||
1156 | sources = set() | 1166 | sources = set() |
1157 | for r in results: | 1167 | for r in results: |
1158 | sources.update(r[1]) | 1168 | sources.update(r[1]) |
@@ -1460,6 +1470,7 @@ PKGDATA_VARS = "PN PE PV PR PKGE PKGV PKGR LICENSE DESCRIPTION SUMMARY RDEPENDS | |||
1460 | python emit_pkgdata() { | 1470 | python emit_pkgdata() { |
1461 | from glob import glob | 1471 | from glob import glob |
1462 | import json | 1472 | import json |
1473 | import gzip | ||
1463 | 1474 | ||
1464 | def process_postinst_on_target(pkg, mlprefix): | 1475 | def process_postinst_on_target(pkg, mlprefix): |
1465 | pkgval = d.getVar('PKG_%s' % pkg) | 1476 | pkgval = d.getVar('PKG_%s' % pkg) |
@@ -1532,6 +1543,8 @@ fi | |||
1532 | with open(data_file, 'w') as fd: | 1543 | with open(data_file, 'w') as fd: |
1533 | fd.write("PACKAGES: %s\n" % packages) | 1544 | fd.write("PACKAGES: %s\n" % packages) |
1534 | 1545 | ||
1546 | pkgdebugsource = d.getVar("PKGDEBUGSOURCES") or [] | ||
1547 | |||
1535 | pn = d.getVar('PN') | 1548 | pn = d.getVar('PN') |
1536 | global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS') or "").split() | 1549 | global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS') or "").split() |
1537 | variants = (d.getVar('MULTILIB_VARIANTS') or "").split() | 1550 | variants = (d.getVar('MULTILIB_VARIANTS') or "").split() |
@@ -1551,17 +1564,32 @@ fi | |||
1551 | pkgval = pkg | 1564 | pkgval = pkg |
1552 | d.setVar('PKG_%s' % pkg, pkg) | 1565 | d.setVar('PKG_%s' % pkg, pkg) |
1553 | 1566 | ||
1567 | extended_data = { | ||
1568 | "files_info": {} | ||
1569 | } | ||
1570 | |||
1554 | pkgdestpkg = os.path.join(pkgdest, pkg) | 1571 | pkgdestpkg = os.path.join(pkgdest, pkg) |
1555 | files = {} | 1572 | files = {} |
1573 | files_extra = {} | ||
1556 | total_size = 0 | 1574 | total_size = 0 |
1557 | seen = set() | 1575 | seen = set() |
1558 | for f in pkgfiles[pkg]: | 1576 | for f in pkgfiles[pkg]: |
1559 | relpth = os.path.relpath(f, pkgdestpkg) | 1577 | fpath = os.sep + os.path.relpath(f, pkgdestpkg) |
1578 | |||
1560 | fstat = os.lstat(f) | 1579 | fstat = os.lstat(f) |
1561 | files[os.sep + relpth] = fstat.st_size | 1580 | files[fpath] = fstat.st_size |
1581 | |||
1582 | extended_data["files_info"].setdefault(fpath, {}) | ||
1583 | extended_data["files_info"][fpath]['size'] = fstat.st_size | ||
1584 | |||
1562 | if fstat.st_ino not in seen: | 1585 | if fstat.st_ino not in seen: |
1563 | seen.add(fstat.st_ino) | 1586 | seen.add(fstat.st_ino) |
1564 | total_size += fstat.st_size | 1587 | total_size += fstat.st_size |
1588 | |||
1589 | if fpath in pkgdebugsource: | ||
1590 | extended_data["files_info"][fpath]['debugsrc'] = pkgdebugsource[fpath] | ||
1591 | del pkgdebugsource[fpath] | ||
1592 | |||
1565 | d.setVar('FILES_INFO', json.dumps(files, sort_keys=True)) | 1593 | d.setVar('FILES_INFO', json.dumps(files, sort_keys=True)) |
1566 | 1594 | ||
1567 | process_postinst_on_target(pkg, d.getVar("MLPREFIX")) | 1595 | process_postinst_on_target(pkg, d.getVar("MLPREFIX")) |
@@ -1582,6 +1610,10 @@ fi | |||
1582 | 1610 | ||
1583 | sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size)) | 1611 | sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size)) |
1584 | 1612 | ||
1613 | subdata_extended_file = pkgdatadir + "/extended/%s.json.gz" % pkg | ||
1614 | with gzip.open(subdata_extended_file, "wt", encoding="utf-8") as f: | ||
1615 | json.dump(extended_data, f, sort_keys=True, separators=(",", ":")) | ||
1616 | |||
1585 | # Symlinks needed for rprovides lookup | 1617 | # Symlinks needed for rprovides lookup |
1586 | rprov = d.getVar('RPROVIDES_%s' % pkg) or d.getVar('RPROVIDES') | 1618 | rprov = d.getVar('RPROVIDES_%s' % pkg) or d.getVar('RPROVIDES') |
1587 | if rprov: | 1619 | if rprov: |
@@ -1612,7 +1644,8 @@ fi | |||
1612 | write_extra_runtime_pkgs(global_variants, packages, pkgdatadir) | 1644 | write_extra_runtime_pkgs(global_variants, packages, pkgdatadir) |
1613 | 1645 | ||
1614 | } | 1646 | } |
1615 | emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime ${PKGDESTWORK}/runtime-reverse ${PKGDESTWORK}/runtime-rprovides" | 1647 | emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime ${PKGDESTWORK}/runtime-reverse ${PKGDESTWORK}/runtime-rprovides ${PKGDESTWORK}/extended" |
1648 | emit_pkgdata[vardepsexclude] = "BB_NUMBER_THREADS" | ||
1616 | 1649 | ||
1617 | ldconfig_postinst_fragment() { | 1650 | ldconfig_postinst_fragment() { |
1618 | if [ x"$D" = "x" ]; then | 1651 | if [ x"$D" = "x" ]; then |
@@ -1620,7 +1653,7 @@ if [ x"$D" = "x" ]; then | |||
1620 | fi | 1653 | fi |
1621 | } | 1654 | } |
1622 | 1655 | ||
1623 | RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/rpmdeps --alldeps" | 1656 | RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/rpmdeps --alldeps --define '__font_provides %{nil}'" |
1624 | 1657 | ||
1625 | # Collect perfile run-time dependency metadata | 1658 | # Collect perfile run-time dependency metadata |
1626 | # Output: | 1659 | # Output: |
@@ -1989,12 +2022,12 @@ python package_do_pkgconfig () { | |||
1989 | for pkg in packages.split(): | 2022 | for pkg in packages.split(): |
1990 | pkgconfig_provided[pkg] = [] | 2023 | pkgconfig_provided[pkg] = [] |
1991 | pkgconfig_needed[pkg] = [] | 2024 | pkgconfig_needed[pkg] = [] |
1992 | for file in pkgfiles[pkg]: | 2025 | for file in sorted(pkgfiles[pkg]): |
1993 | m = pc_re.match(file) | 2026 | m = pc_re.match(file) |
1994 | if m: | 2027 | if m: |
1995 | pd = bb.data.init() | 2028 | pd = bb.data.init() |
1996 | name = m.group(1) | 2029 | name = m.group(1) |
1997 | pkgconfig_provided[pkg].append(name) | 2030 | pkgconfig_provided[pkg].append(os.path.basename(name)) |
1998 | if not os.access(file, os.R_OK): | 2031 | if not os.access(file, os.R_OK): |
1999 | continue | 2032 | continue |
2000 | with open(file, 'r') as f: | 2033 | with open(file, 'r') as f: |
@@ -2017,7 +2050,7 @@ python package_do_pkgconfig () { | |||
2017 | pkgs_file = os.path.join(shlibswork_dir, pkg + ".pclist") | 2050 | pkgs_file = os.path.join(shlibswork_dir, pkg + ".pclist") |
2018 | if pkgconfig_provided[pkg] != []: | 2051 | if pkgconfig_provided[pkg] != []: |
2019 | with open(pkgs_file, 'w') as f: | 2052 | with open(pkgs_file, 'w') as f: |
2020 | for p in pkgconfig_provided[pkg]: | 2053 | for p in sorted(pkgconfig_provided[pkg]): |
2021 | f.write('%s\n' % p) | 2054 | f.write('%s\n' % p) |
2022 | 2055 | ||
2023 | # Go from least to most specific since the last one found wins | 2056 | # Go from least to most specific since the last one found wins |