summaryrefslogtreecommitdiffstats
path: root/showdependencygraph.cgi
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-03-31 14:19:06 +0200
committerbbaetz%student.usyd.edu.au <>2002-03-31 14:19:06 +0200
commitd8dad92ff903380dfec153f254ec671fbe91f969 (patch)
treefb088c399349072a80302b86dc68007d6e4a9099 /showdependencygraph.cgi
parent4b366f54be11045f74310f2170cd199e4df92209 (diff)
downloadbugzilla-d8dad92ff903380dfec153f254ec671fbe91f969.tar.gz
bugzilla-d8dad92ff903380dfec153f254ec671fbe91f969.tar.xz
Bug 120537 - Allow the use of a local 'dot' binary to generate dependancy
graphs patch by zeroJ@null.net (John Vandenberg), r=gerv, bbaetz
Diffstat (limited to 'showdependencygraph.cgi')
-rwxr-xr-xshowdependencygraph.cgi18
1 files changed, 13 insertions, 5 deletions
diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi
index 4bb90d497..7c59a26db 100755
--- a/showdependencygraph.cgi
+++ b/showdependencygraph.cgi
@@ -163,13 +163,21 @@ node [URL="${urlbase}show_bug.cgi?id=\\N", style=filled, color=lightgrey]
close DOT;
chmod 0777, $filename;
- my $url = PerformSubsts(Param("webdotbase")) . $filename;
-
- print qq{<a href="$url.map"> <img src="$url.gif" ismap> </a><hr>\n};
-
+ my $webdotbase = Param('webdotbase');
+ if($webdotbase =~ /^https?:/) {
+ my $url = PerformSubsts(Param("webdotbase")) . $filename;
+ print qq{<a href="$url.map"> <img src="$url.gif" ismap> </a><hr>\n};
+ } else {
+ my $pngfilename = "data/webdot/$$.png";
+ my $mapfilename = "data/webdot/$$.map";
+ system("$webdotbase","-Tpng","-o","$pngfilename","$filename");
+ system("$webdotbase","-Timap","-o","$mapfilename","$filename");
+ print qq{<a href="$mapfilename"> <img src="$pngfilename" ismap> </a><hr>\n};
+ }
+
# Cleanup any old .dot files created from previous runs.
my $since = time() - 24 * 60 * 60;
- foreach my $f (glob("data/webdot/*.dot")) {
+ foreach my $f (glob("data/webdot/*.dot data/webdot/*.png data/webdot/*.map")) {
# Here we are deleting all old files. All entries are from the
# data/webdot/ directory. Since we're deleting the file (not following
# symlinks), this can't escape to delete anything it shouldn't