You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2005/10/30 21:39:26 UTC

svn commit: r329632 - /spamassassin/trunk/masses/rule-qa/rule-hits-over-time

Author: jm
Date: Sun Oct 30 12:39:25 2005
New Revision: 329632

URL: http://svn.apache.org/viewcvs?rev=329632&view=rev
Log:
temp files, CGI and what-not

Modified:
    spamassassin/trunk/masses/rule-qa/rule-hits-over-time

Modified: spamassassin/trunk/masses/rule-qa/rule-hits-over-time
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/masses/rule-qa/rule-hits-over-time?rev=329632&r1=329631&r2=329632&view=diff
==============================================================================
--- spamassassin/trunk/masses/rule-qa/rule-hits-over-time (original)
+++ spamassassin/trunk/masses/rule-qa/rule-hits-over-time Sun Oct 30 12:39:25 2005
@@ -87,9 +87,10 @@
 my $seen_n;
 
 my $tmpdir = "/tmp/rulehits.$$";
+mkdir ($tmpdir) or die "collided on $tmpdir";
+
 my $outdir = ".";
 if ($opt_cgi) {
-  mkdir ($tmpdir) or die "collided on $tmpdir";
   $outdir = $tmpdir;
 }
 
@@ -179,9 +180,9 @@
   $both->gif();
 }
 
-if ($opt_cgi) {
-  system ("cd /; rm -rf $tmpdir");      # clean up tmp files
-}
+unlink(<$tmpdir/*.*>);
+rmdir $tmpdir;
+
 exit;
 
 sub summarise {
@@ -306,7 +307,7 @@
         xff3300 x0000cc x99cc00 xff9900 \\
         xcccc00 x333333 x999999 x9500d3
 
-    set out 'out.png'
+    set out '$tmpdir/out.png'
 
     set grid back xtics ytics
 
@@ -361,7 +362,7 @@
     close GP;
 
     my $graphname = sprintf("file%02d", $fname_counter++);
-    $graph_png_data{$graphname} = readfile("out.png");
+    $graph_png_data{$graphname} = readfile("$tmpdir/out.png");
   }
 }