diff options
| -rw-r--r-- | meta/classes/buildhistory.bbclass | 4 | ||||
| -rw-r--r-- | meta/lib/oe/utils.py | 32 |
2 files changed, 33 insertions, 3 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index cdcf99a499..a613306270 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
| @@ -446,7 +446,7 @@ def buildhistory_list_installed(d, rootfs_type="image"): | |||
| 446 | output_file_full = os.path.join(d.getVar('WORKDIR'), output_file) | 446 | output_file_full = os.path.join(d.getVar('WORKDIR'), output_file) |
| 447 | 447 | ||
| 448 | with open(output_file_full, 'w') as output: | 448 | with open(output_file_full, 'w') as output: |
| 449 | output.write(format_pkg_list(pkgs, output_type)) | 449 | output.write(format_pkg_list(pkgs, output_type, d.getVar('PKGDATA_DIR'))) |
| 450 | 450 | ||
| 451 | python buildhistory_list_installed_image() { | 451 | python buildhistory_list_installed_image() { |
| 452 | buildhistory_list_installed(d) | 452 | buildhistory_list_installed(d) |
| @@ -487,6 +487,8 @@ buildhistory_get_installed() { | |||
| 487 | -e 's:|: -> :' \ | 487 | -e 's:|: -> :' \ |
| 488 | -e 's:"\[REC\]":[style=dotted]:' \ | 488 | -e 's:"\[REC\]":[style=dotted]:' \ |
| 489 | -e 's:"\([<>=]\+\)" "\([^"]*\)":[label="\1 \2"]:' \ | 489 | -e 's:"\([<>=]\+\)" "\([^"]*\)":[label="\1 \2"]:' \ |
| 490 | -e 's:"\([*]\+\)" "\([^"]*\)":[label="\2"]:' \ | ||
| 491 | -e 's:"\[RPROVIDES\]":[style=dashed]:' \ | ||
| 490 | $1/depends.tmp | 492 | $1/depends.tmp |
| 491 | # Add header, sorted and de-duped contents and footer and then delete the temp file | 493 | # Add header, sorted and de-duped contents and footer and then delete the temp file |
| 492 | printf "digraph depends {\n node [shape=plaintext]\n" > $1/depends.dot | 494 | printf "digraph depends {\n node [shape=plaintext]\n" > $1/depends.dot |
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index a84039f585..238af314d1 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py | |||
| @@ -344,7 +344,29 @@ def squashspaces(string): | |||
| 344 | import re | 344 | import re |
| 345 | return re.sub(r"\s+", " ", string).strip() | 345 | return re.sub(r"\s+", " ", string).strip() |
| 346 | 346 | ||
| 347 | def format_pkg_list(pkg_dict, ret_format=None): | 347 | def rprovides_map(pkgdata_dir, pkg_dict): |
| 348 | # Map file -> pkg provider | ||
| 349 | rprov_map = {} | ||
| 350 | |||
| 351 | for pkg in pkg_dict: | ||
| 352 | path_to_pkgfile = os.path.join(pkgdata_dir, 'runtime-reverse', pkg) | ||
| 353 | if not os.path.isfile(path_to_pkgfile): | ||
| 354 | continue | ||
| 355 | with open(path_to_pkgfile) as f: | ||
| 356 | for line in f: | ||
| 357 | if line.startswith('RPROVIDES') or line.startswith('FILERPROVIDES'): | ||
| 358 | # List all components provided by pkg. | ||
| 359 | # Exclude version strings, i.e. those starting with ( | ||
| 360 | provides = [x for x in line.split()[1:] if not x.startswith('(')] | ||
| 361 | for prov in provides: | ||
| 362 | if prov in rprov_map: | ||
| 363 | rprov_map[prov].append(pkg) | ||
| 364 | else: | ||
| 365 | rprov_map[prov] = [pkg] | ||
| 366 | |||
| 367 | return rprov_map | ||
| 368 | |||
| 369 | def format_pkg_list(pkg_dict, ret_format=None, pkgdata_dir=None): | ||
| 348 | output = [] | 370 | output = [] |
| 349 | 371 | ||
| 350 | if ret_format == "arch": | 372 | if ret_format == "arch": |
| @@ -357,9 +379,15 @@ def format_pkg_list(pkg_dict, ret_format=None): | |||
| 357 | for pkg in sorted(pkg_dict): | 379 | for pkg in sorted(pkg_dict): |
| 358 | output.append("%s %s %s" % (pkg, pkg_dict[pkg]["arch"], pkg_dict[pkg]["ver"])) | 380 | output.append("%s %s %s" % (pkg, pkg_dict[pkg]["arch"], pkg_dict[pkg]["ver"])) |
| 359 | elif ret_format == "deps": | 381 | elif ret_format == "deps": |
| 382 | rprov_map = rprovides_map(pkgdata_dir, pkg_dict) | ||
| 360 | for pkg in sorted(pkg_dict): | 383 | for pkg in sorted(pkg_dict): |
| 361 | for dep in pkg_dict[pkg]["deps"]: | 384 | for dep in pkg_dict[pkg]["deps"]: |
| 362 | output.append("%s|%s" % (pkg, dep)) | 385 | if dep in rprov_map: |
| 386 | # There could be multiple providers within the image | ||
| 387 | for pkg_provider in rprov_map[dep]: | ||
| 388 | output.append("%s|%s * %s [RPROVIDES]" % (pkg, pkg_provider, dep)) | ||
| 389 | else: | ||
| 390 | output.append("%s|%s" % (pkg, dep)) | ||
| 363 | else: | 391 | else: |
| 364 | for pkg in sorted(pkg_dict): | 392 | for pkg in sorted(pkg_dict): |
| 365 | output.append(pkg) | 393 | output.append(pkg) |
