$NetBSD: patch-quickml-analog.in,v 1.2 2012/08/11 13:51:20 obache Exp $ * for ruby-1.9 (use fileutils instead of deprecated ftools) * gnuplot>=4.0 support. --- quickml-analog.in.orig 2004-06-07 08:50:59.000000000 +0000 +++ quickml-analog.in @@ -12,9 +12,10 @@ # require 'getoptlong' -require 'ftools' +require 'fileutils' require 'time' require 'cgi' +require 'open3' class Array def tail (n) @@ -395,6 +396,12 @@ class QuickMLPlot end def add_basic (f) + Open3.popen3( "gnuplot" ) { |stdin, stdout, stderr| + stdin.puts "show version" + stdin.close + stderr.read[/[Vv]ersion (\d+\.\d+)/] + } + if ( Float( $1 ) < 4.0 ) then f.print ' set grid set timefmt "%y%m%d%H" @@ -408,6 +415,21 @@ class QuickMLPlot set linestyle 6 linetype 7 linewidth 5 '.gsub(/^ /, "") + else + f.print ' + set grid + set timefmt "%y%m%d%H" + set xdata time + set size ratio 0.76 + set style line 1 linetype 1 linewidth 5 + set style line 2 linetype 3 linewidth 5 + set style line 3 linetype 2 linewidth 5 + set style line 4 linetype 4 linewidth 5 + set style line 5 linetype 5 linewidth 5 + set style line 6 linetype 7 linewidth 5 + + '.gsub(/^ /, "") + end end def add_chart (f, default, lang, chart_prefix, stat_files, type,