diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2023-04-06 18:59:14 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2023-04-06 21:31:03 +0300 |
commit | 1e16eb115b67f70c293860d54ef399dd35d81d33 (patch) | |
tree | 02025c9c207a0630cbdcefde0543c986e334befb /calm/pkg2html.py | |
parent | 9616ae8068814cd07e5e935827e84930921be118 (diff) |
Add obsoletes_by to package summary page
It would be nice to also show rdepends and rbuild_depends, but those
could be huge lists.
Diffstat (limited to 'calm/pkg2html.py')
-rwxr-xr-x | calm/pkg2html.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/calm/pkg2html.py b/calm/pkg2html.py index ee8fdea..a4cd59a 100755 --- a/calm/pkg2html.py +++ b/calm/pkg2html.py @@ -212,7 +212,9 @@ def update_package_listings(args, packages): if po.kind == package.Kind.source: details = ['build-depends'] else: - details = ['depends', 'obsoletes', 'provides', 'conflicts'] + details = ['depends', 'obsoletes', 'obsoleted_by', 'provides', 'conflicts'] + + detail_is_attr = ['obsoleted_by'] for key in details: # make the union of the package list for this detail @@ -221,11 +223,15 @@ def update_package_listings(args, packages): value = {} values = set() for arch in pos: - t = pos[arch].version_hints[pos[arch].best_version].get(key, None) - if t: - value[arch] = set(t.split(', ')) + if key in detail_is_attr: + value[arch] = getattr(pos[arch], key, set()) else: - value[arch] = set() + t = pos[arch].version_hints[pos[arch].best_version].get(key, None) + + if t: + value[arch] = set(t.split(', ')) + else: + value[arch] = set() values.update(value[arch]) if values: |