diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-06-27 21:30:38 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-06-27 23:28:48 (EDT) |
commit | 4bfe39bdb6fd9f76be70783b1558d0c29f1dcd1d (patch) | |
tree | 4440ee0636083479ec57b181223b97d331c9caa2 | |
parent | f3efc9915f1daa1b5a627babc945d364b6592a6d (diff) |
Render isolated src pkg nodes and print comments
-rwxr-xr-x | bin/depsdot | 17 |
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 = ''; |