Package list rust-stfu8 / d8ce215
rust-excuses: show more problems, improve layout slightly Ximin Luo 1 year, 10 months ago
2 changed file(s) with 24 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
00 #!/usr/bin/make -f
11 # Output a nice graph of why stuff isn't yet in Debian Testing.
22 #
3 # - Red nodes means it's not in Debian
4 # - Yellow nodes means it's in Debian, but something else needs a different
5 # version of it.
3 # - Red oval nodes means it's not in Debian
4 # - Yellow oval nodes means it's in Debian, but something else needs a
5 # different version of it.
66 # - For nodes with no children, it probably means that there is an older
77 # version already in Debian Testing, and something else needs this specific
88 # older version and can't work with the newer version. Unfortunately the
2727 dev/rust-excuses.py rust-excuses.dot rust-excuses-arch.dot
2828
2929 %.png: %.dot
30 dot -Tpng "$<" > "$@"
30 unflatten -c 10 "$<" | dot -Tpng > "$@"
3131
3232 refresh:
3333 $(DOWNLOAD)
0 #!/usr/bin/python3
0 #!/usr/bin/pypy3
1 # pypy3 runs faster than python3
2 #
13 # the excuses file can be found here:
24 # https://release.debian.org/britney/excuses.yaml
35
3133
3234 already_seen = set()
3335
34
3536 def edge_dep(name, dep):
3637 return " ".join(['"%s"' % name, "->", '"%s"' % dep])
3738
38
3939 def edge_dep_label(name, dep, label):
4040 return " ".join(['"%s"' % name, "->", '"%s"' % dep, '[label="%s"]' % label])
41
4241
4342 def print_all(*args, **kwargs):
4443 print(*args, **kwargs, file=rust_excuses)
4544 print(*args, **kwargs, file=rust_excuses_arch)
4645
47
4846 is_in_debian_cache = {}
49
50
5147 def is_in_debian(src):
5248 global is_in_debian_cache
5349 if src not in is_in_debian_cache:
5955 x = is_in_debian_cache[src]
6056 return x
6157
58
59 BG_NOT_IN_DEBIAN = "#cc0000"
60 BG_OLD_IN_DEBIAN = "#ffcc66"
61 BG_TOO_NEW = "#66ff99"
62 BG_MISC_FAIL = "#ff6666"
6263
6364 def traverse(name, arch="", d=0):
6465 if name in already_seen:
8687 )
8788 if dep not in already_seen:
8889 if is_in_debian(dep):
89 print_all('"%s" [fillcolor="#ffcc66",style=filled]' % dep)
90 print_all('"%s" [fillcolor="%s",style=filled]' % (dep, BG_OLD_IN_DEBIAN))
9091 else:
91 print_all('"%s" [fillcolor="#ff6666",style=filled]' % dep)
92 print_all('"%s" [fillcolor="%s",style=filled]' % (dep, BG_NOT_IN_DEBIAN))
9293 for edge in edges:
9394 print(edge, file=rust_excuses)
9495
102103 print_all(edge_dep(name, dep))
103104 traverse(dep, arch, d + 1)
104105
105 if not dependencies:
106 age = excuses.get(name, {}).get("policy_info", {}).get("age", {})
107 if age.get("verdict", "") == "REJECTED_TEMPORARILY":
108 print_all('"%s" [fillcolor="#66ff99",style=filled]' % name)
106 policy = excuses.get(name, {}).get("policy_info", {})
107 failed = [k for (k, v) in policy.items() if v.get("verdict", "") != "PASS"]
108 attrs = {"shape": "box"}
109 if "age" in failed:
110 failed = failed.remove("age")
111 attrs.update({ "fillcolor": BG_TOO_NEW, "style": "filled" })
112 if failed:
113 attrs.update({ "label": "\\N\\nfailed: %s" % ",".join(failed) })
114 attrs.update({ "fillcolor": BG_MISC_FAIL, "style": "filled" })
115 print_all('"%s" [%s]' % (name, ",".join("%s=\"%s\"" % p for p in attrs.items())))
109116
110117
111118 # import code