aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2024-01-25 18:00:19 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2024-01-25 18:00:19 +0200
commit68de4d0eaa6d95c1692320b01da5f5328ac770e9 (patch)
tree13c0fd643f5bb4d52bf7bfd5693ae0d20a1ea2e4
parentCI: test Python 3.13, promote Python 3.12 to non-exp (diff)
downloadpkgdev-68de4d0eaa6d95c1692320b01da5f5328ac770e9.tar.gz
pkgdev-68de4d0eaa6d95c1692320b01da5f5328ac770e9.tar.bz2
pkgdev-68de4d0eaa6d95c1692320b01da5f5328ac770e9.zip
bugs: indicate why dependent packages are added
Resolves: https://github.com/pkgcore/pkgdev/issues/170 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--src/pkgdev/scripts/pkgdev_bugs.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pkgdev/scripts/pkgdev_bugs.py b/src/pkgdev/scripts/pkgdev_bugs.py
index 75ae274..86f5247 100644
--- a/src/pkgdev/scripts/pkgdev_bugs.py
+++ b/src/pkgdev/scripts/pkgdev_bugs.py
@@ -477,12 +477,12 @@ class DependencyGraph:
self.targets = tuple(result)
def build_full_graph(self):
- check_nodes = [(pkg, set()) for pkg in self.targets]
+ check_nodes = [(pkg, set(), "") for pkg in self.targets]
vertices: dict[package, GraphNode] = {}
edges = []
while len(check_nodes):
- pkg, keywords = check_nodes.pop(0)
+ pkg, keywords, reason = check_nodes.pop(0)
if pkg in vertices:
vertices[pkg].pkgs[0][1].update(keywords)
continue
@@ -497,14 +497,16 @@ class DependencyGraph:
), f"no keywords for {pkg.versioned_atom}, currently unsupported by tool: https://github.com/pkgcore/pkgdev/issues/123"
self.nodes.add(new_node := GraphNode(((pkg, keywords),)))
vertices[pkg] = new_node
+ if reason:
+ reason = f" [added for {reason}]"
self.out.write(
- f"Checking {pkg.versioned_atom} on {' '.join(sort_keywords(keywords))!r}"
+ f"Checking {pkg.versioned_atom} on {' '.join(sort_keywords(keywords))!r}{reason}"
)
self.out.flush()
for dep, keywords in self._find_dependencies(pkg, keywords):
edges.append((pkg, dep))
- check_nodes.append((dep, keywords))
+ check_nodes.append((dep, keywords, str(pkg.versioned_atom)))
for src, dst in edges:
vertices[src].edges.add(vertices[dst])