Add a script to output a graph of why things aren't in testing yet
Ximin Luo
4 years ago
0 | 0 |
/build
|
1 | 1 |
/src/*/*
|
2 | 2 |
!/src/*/debian
|
|
3 |
|
|
4 |
/excuses.yaml
|
|
5 |
/rust-excuses*.*
|
|
0 |
#!/usr/bin/make -f
|
|
1 |
# Output a nice graph of why stuff isn't yet in Debian Testing.
|
|
2 |
#
|
|
3 |
# Usage:
|
|
4 |
# $ dev/rust-excuses.mk refresh all
|
|
5 |
|
|
6 |
DST = rust-excuses.png rust-excuses-arch.png
|
|
7 |
DOWNLOAD = wget -N --no-use-server-timestamps https://release.debian.org/britney/excuses.yaml
|
|
8 |
|
|
9 |
all: $(DST)
|
|
10 |
|
|
11 |
clean:
|
|
12 |
rm -rf $(DST) $(DST:%.png=%.dot) excuses.yaml
|
|
13 |
|
|
14 |
excuses.yaml:
|
|
15 |
$(DOWNLOAD)
|
|
16 |
|
|
17 |
rust-excuses.dot rust-excuses-arch.dot: excuses.yaml dev/rust-excuses.py
|
|
18 |
dev/rust-excuses.py rust-excuses.dot rust-excuses-arch.dot
|
|
19 |
|
|
20 |
%.png: %.dot
|
|
21 |
dot -Tpng "$<" > "$@"
|
|
22 |
|
|
23 |
refresh:
|
|
24 |
$(DOWNLOAD)
|
|
25 |
.PHONY: refresh
|
|
0 |
#!/usr/bin/python3
|
|
1 |
|
|
2 |
import sys
|
|
3 |
import yaml
|
|
4 |
|
|
5 |
print("parsing excuses.yaml...", file=sys.stderr)
|
|
6 |
with open("excuses.yaml") as fp:
|
|
7 |
y = yaml.load(fp)
|
|
8 |
|
|
9 |
excuses = {}
|
|
10 |
for e in y["sources"]:
|
|
11 |
excuses[e["source"]] = e
|
|
12 |
|
|
13 |
rust_excuses = open(sys.argv[1], "w")
|
|
14 |
rust_excuses_arch = open(sys.argv[2], "w")
|
|
15 |
|
|
16 |
already_seen = set()
|
|
17 |
|
|
18 |
def print_all(*args, **kwargs):
|
|
19 |
print(*args, **kwargs, file=rust_excuses)
|
|
20 |
print(*args, **kwargs, file=rust_excuses_arch)
|
|
21 |
|
|
22 |
def traverse(name, arch="", d=0):
|
|
23 |
if name in already_seen:
|
|
24 |
return
|
|
25 |
already_seen.add(name)
|
|
26 |
for dep in excuses.get(name, {}).get("dependencies", {}).get("migrate-after", []):
|
|
27 |
if "/" in dep:
|
|
28 |
dep, arch = dep.split("/")
|
|
29 |
print('"%s"' % name, "->", '"%s"' % dep, '[label="%s"]' % arch,
|
|
30 |
file=rust_excuses_arch)
|
|
31 |
else:
|
|
32 |
print_all('"%s"' % name, "->", '"%s"' % dep)
|
|
33 |
traverse(dep, arch, d+1)
|
|
34 |
|
|
35 |
print_all("digraph {")
|
|
36 |
for s in excuses.keys():
|
|
37 |
if s.startswith("rust-"):
|
|
38 |
traverse(s)
|
|
39 |
print_all("}")
|