my $q = new CGI::Simple;
my %cgi_var = cgi_parameters(query => $q,
- single => [qw(package format ignore_boring)],
+ single => [qw(package format ignore_boring width height)],
default => {package => 'xterm',
found => [],
fixed => [],
ignore_boring => 1,
format => 'png',
+ width => undef,
+ height => undef,
},
);
# then figure out which versions are there in which architectures,
my %versions;
my %version_to_dist;
-for my $dist (qw(oldstable stable testing unstable experimental)) {
+for my $dist (@{$config{distributions}}) {
$versions{$dist} = [getversions($cgi_var{package},$dist)];
# make version_to_dist
foreach my $version (@{$versions{$dist}}){
push @{$version_to_dist{$version}}, $dist;
}
}
+
+if (defined $cgi_var{width}) {
+ $cgi_var{width} =~ /(\d+)/;
+ $cgi_var{width} = $1;
+}
+if (defined $cgi_var{height}) {
+ $cgi_var{height} =~ /(\d+)/;
+ $cgi_var{height} = $1;
+}
+
+if (defined $cgi_var{format}) {
+ $cgi_var{format} =~ /(png|svg|jpg|gif)/;
+ $cgi_var{format} = $1 || 'png';
+}
+else {
+ $cgi_var{format} = 'png';
+}
+
# then figure out which are affected.
# turn found and fixed into full versions
@{$cgi_var{found}} = makesourceversions($cgi_var{package},undef,@{$cgi_var{found}});
my %all_states = $version->allstates($cgi_var{found},$cgi_var{fixed});
my $dot = "digraph G {\n";
+if (defined $cgi_var{width} and defined $cgi_var{height}) {
+ $dot .= qq(size="$cgi_var{width},$cgi_var{height}";\n);
+}
my %state = (found => ['fillcolor="salmon"',
'style="filled"',
'shape="diamond"',
'shape="rect"',
],
);
+# TODO: Allow collapsing versions which are at the same state and not
+# in a suite.
foreach my $key (keys %all_states) {
my ($short_version) = $key =~ m{/(.+)$};
next if $cgi_var{ignore_boring} and (not defined $all_states{$key}