[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 02/02: r/html_reports: Attempt to reduce the calls to gnuplot



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 83d33776900d1b96e4bd09352dbc2feccfdc4d31
Author: Niels Thykier <niels@thykier.net>
Date:   Wed Jan 15 19:21:16 2014 +0100

    r/html_reports: Attempt to reduce the calls to gnuplot
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 reporting/graphs/tags.gpi |  1 +
 reporting/html_reports    | 21 +++++++++++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/reporting/graphs/tags.gpi b/reporting/graphs/tags.gpi
index 3493299..439e328 100644
--- a/reporting/graphs/tags.gpi
+++ b/reporting/graphs/tags.gpi
@@ -1,3 +1,4 @@
+tag=$0
 # set terminal png truecolor small size 600,300
 set terminal svg size 640,375 font "Sans,11"
 
diff --git a/reporting/html_reports b/reporting/html_reports
index 4b62670..b0a7734 100755
--- a/reporting/html_reports
+++ b/reporting/html_reports
@@ -661,6 +661,16 @@ if ($GRAPHS) {
       or die "gnuplot died with $?\n";
 }
 
+my $gnuplot_fd;
+if ($GRAPHS) {
+    my $pid = open($gnuplot_fd, '|-');
+    if (not $pid) {
+        chdir($graph_dir);
+        exec('gnuplot', '-')
+          or die("exec \"gnuplot -\" failed: $!");
+    }
+}
+
 for my $tag (sort keys %tag_statistics) {
     $history_file = "$HISTORY_DIR/tags/$tag.dat";
     $stats = $tag_statistics{$tag};
@@ -670,18 +680,13 @@ for my $tag (sort keys %tag_statistics) {
     close($tag_fd);
     if ($GRAPHS) {
         print "Plotting $tag statistics...\n";
-        chdir_system(
-            $graph_dir,
-            [
-                'gnuplot', '-e',
-                "tag='$tag'","$LINTIAN_ROOT/reporting/graphs/tags.gpi"
-            ]
-          ) == 0
-          or die "gnuplot died with $?\n";
+        print {$gnuplot_fd}
+          qq{call "$LINTIAN_ROOT/reporting/graphs/tags.gpi" "$tag"\n};
     }
 }
 
 if ($GRAPHS) {
+    close($gnuplot_fd);
     unlink($commonf);
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: