no warnings qw(recursion);
use HTML::Entities;
use Osstest::Executive;
+use URI::Escape;
our @blessings= qw(real real-bisect);
our @revtuplegenargs= ();
sub writegraph () {
return unless length $graphfile;
- open DOT, "> $graphfile.dot" or die "$graphfile.dot $!";
+ open DOT, ">", "$graphfile.dot" or die "$graphfile.dot $!";
odot(<<END);
digraph "$job $testid" {
my $href= $graphfile;
$href =~ s,.*/,,;
+ $href = uri_escape($href, '^-._+,=0-9a-zA-Z');
- open HTML, "> $graphfile.html" or die "$graphfile.html $!";
+ open HTML, ">", "$graphfile.html" or die "$graphfile.html $!";
print HTML <<END
<html><head><title>bisection $branch $job $testid</title></head>
<body>
if (eval {
foreach my $fmt (qw(ps png)) {
- system_checked("dot -T$fmt -o$graphfile.$fmt $graphfile.dot");
+ system_checked("dot", "-T$fmt", "-o$graphfile.$fmt",
+ "$graphfile.dot");
}
1;
}) {
my $gsize = $c{BisectionRevisonGraphSize};
- system_checked("pngtopnm <$graphfile.png".
- " | pnmscale -xysize ".
- ($gsize =~ m/^(\d+)x(\d+)$/ ? "$1 $2" :
- $gsize =~ m/^(\d+)$/ ? "$1 $1" :
- die "$gsize ?").
- " | pnmtopng >$graphfile.mini.png");
+ my $scriptlet = 'pngtopnm <$1';
+ $scriptlet .= " | pnmscale -xysize ";
+ $scriptlet .= $gsize =~ m/^(\d+)x(\d+)$/ ? "$1 $2" :
+ $gsize =~ m/^(\d+)$/ ? "$1 $1" :
+ die "$gsize ?";
+ $scriptlet .= ' | pnmtopng >$2';
+ system_checked(qw(sh -ec), $scriptlet, 'x',
+ "$graphfile.png", "$graphfile.mini.png");
print HTML <<END or die $!;
<h2>Revision graph overview</h2>
<img src="$href.mini.png">