X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Fdbupgrade2_tool.pl;h=0e1194dc87bff3f17374b625233fc2e00b48b03a;hb=70e1559de935668f85affe8c2e73eaa45d3d1715;hp=31b997c3c24576008f65d615aa0014f588d625ac;hpb=92fc1394dae925962c06e0250d9f1901e89b96d1;p=kivitendo-erp.git diff --git a/scripts/dbupgrade2_tool.pl b/scripts/dbupgrade2_tool.pl index 31b997c3c..0e1194dc8 100755 --- a/scripts/dbupgrade2_tool.pl +++ b/scripts/dbupgrade2_tool.pl @@ -152,20 +152,25 @@ sub dump_graphviz { print("GRAPHVIZ POSTCRIPT\n\n"); print("Output will be written to '${file_name}'\n"); + + calc_rev_depends(); + $dot = "|dot -Tps "; - open(OUT, "${dot}> \"${file_name}\""); + open OUT, "${dot}> \"${file_name}\"" || die; + print(OUT "digraph db_dependencies {\n" . - "node [shape=box];\n"); + "node [shape=box style=filled fillcolor=white];\n"); my %ranks; foreach my $c (values(%{$controls})) { - $ranks{$c->{"depth"}} = [] unless ($ranks{$c->{"depth"}}); - push(@{$ranks{$c->{"depth"}}}, $c->{"tag"}); + $ranks{$c->{"depth"}} ||= []; + + my ($pre, $post) = ('node [fillcolor=lightgray] ', 'node [fillcolor=white] ') if !@{ $c->{"rev_depends"} }; + + push @{ $ranks{$c->{"depth"}} }, qq|${pre}"$c->{tag}"; ${post}|; } foreach (sort(keys(%ranks))) { - print(OUT "{ rank = same; " . - join("", map({ '"' . $_ . '"; ' } @{$ranks{$_}})) . - " }\n"); + print OUT "{ rank = same; ", join("", @{ $ranks{$_} }), " }\n"; } foreach my $c (values(%{$controls})) { print(OUT "$c->{tag};\n");