summarylogtreecommitdiffstats
path: root/graphviz-deps.sh
blob: 9292074b8f830cec3cbde1ea6016693454cbdd9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

{
	printf 'digraph deps {\noverlap=scale;\n'
	sed -r '
		s/\([^()]*\)//g
		s/(collaboraofficebasis5.3)-[a-z]{2,3}(-[a-z]+)*-(calc|res|writer)/\1-LANG-\3/g
		s/(collaboraoffice5.3-dict|collaboraofficebasis5.3)-[a-z]{2,3}(-[a-z]+)*($|[^-a-z])/\1-LANG\3/g
	' Packages \
	| tr -d ' ' | tr '.+-' _ \
	| gawk -F: '
		function pr() {
			if (p ~ /_dev$/ || p ~ /_dbgsym/) return
			split(d, a, ",")
			for (i in a) if (a[i] != "") printf("%s -> %s;\n", p, a[i])
			p=""
			d=""
		}
		/^Package/ { p=$2 }
		/^Depends/ { d=$2 }
		/^$/ { pr() }
		END  { pr() }
	' | sort -u
	echo '}'
} >deps.dot
dot -Tpdf deps.dot >dot.pdf
twopi -Tpdf deps.dot >twopi.pdf
circo -Tpdf deps.dot >circo.pdf