summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/depsdot17
1 files changed, 15 insertions, 2 deletions
diff --git a/bin/depsdot b/bin/depsdot
index 79c4a53..f338abc 100755
--- a/bin/depsdot
+++ b/bin/depsdot
@@ -7,11 +7,13 @@ use autovivification;
use English qw(-no_match_vars);
use LWP::Simple;
+use POSIX qw(strftime);
my $BASE_URL = 'http://files.proteanos.com/pub/proteanos/feeds/dev/trunk';
my @DEP_FIELDS = qw(Depends Recommends Suggests Pre-Depends);
my @IGNORE_DEPS = qw(libc.6);
+my @src_pkgs;
my %bin_src_map;
my %rdeps_graph;
my %deps_graph;
@@ -36,7 +38,9 @@ sub read_list
push(@deps, split(m{\s*,\s*}, $value));
}
}
- if (not $is_src) {
+ if ($is_src) {
+ push(@src_pkgs, $source);
+ } else {
$bin_src_map{$package}{$source} = 1;
}
map({ $_ =~ s{[\s(].*$}{}; } @deps); # Vim: )
@@ -58,7 +62,6 @@ sub main
read_list($BASE_URL . '/' . $aps . '/Packages',
($aps =~ m{^src/}));
}
- STDOUT->print("digraph deps {\n");
foreach my $dep_bin (keys(%rdeps_graph)) {
foreach my $src (keys(%{$rdeps_graph{$dep_bin}})) {
my @dep_srcs = keys(%{$bin_src_map{$dep_bin}});
@@ -68,6 +71,16 @@ sub main
}
}
}
+ STDOUT->print("/*\n * ProteanOS source package dependencies\n" .
+ ' * Generated ' . strftime('on %Y-%m-%d at %H:%M:%S %Z',
+ localtime()) . "\n" .
+ " * Render with neato(1) from Graphviz.\n */\n\n" .
+ "digraph deps {\n\toverlap = false;\n\tsplines = true;\n\n" .
+ "\t/* Source packages */\n");
+ foreach my $src (sort(@src_pkgs)) {
+ STDOUT->print("\t\"" . $src . "\";\n");
+ }
+ STDOUT->print("\n\t/* Dependencies */\n");
foreach my $src (sort(keys(%deps_graph))) {
foreach my $dep_src (sort(keys(%{$deps_graph{$src}}))) {
my $attr = '';