[SCM] Feedgnuplot. Pipe-oriented frontend to Gnuplot. branch, debian, updated. debian/1.23-2-15-g184102a

Dima Kogan dima at secretsauce.net
Fri Feb 8 10:32:57 UTC 2013


The following commit has been merged in the debian branch:
commit 28742230b65b886dd8488f7b23d21eb77b757184
Author: Dima Kogan <dima at secretsauce.net>
Date:   Fri Feb 8 01:43:19 2013 -0800

    main script now has the version

diff --git a/Makefile.PL b/Makefile.PL
index b14e8c8..3b28356 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -9,12 +9,28 @@ sub parseversion
 # libpackage-perl (0.02)
 #
 # I parse out the 0.02 part
-  open DCH, 'Changes' or die "Couldn't open 'Changes'";
+  open DCH, '<', 'Changes' or die "Couldn't open 'Changes'";
   my ($version) = <DCH> =~ /^\S+ \s* \( ([0-9\.]+) \)/x
     or die "Couldn't parse version from 'Changes'";
   close DCH;
 
-  return $version;
+  # The version is also stored in the script itself. Here I extract that version
+  # number and make sure the two match
+  open PL, '<', 'bin/feedgnuplot' or die "Couldn't open 'bin/feedgnuplot'";
+
+  while(<PL>)
+  {
+    if( /VERSION = ([0-9\.]+)/ )
+    {
+      if ( $1 != $version )
+      {
+        die "Version mismatch. Changes says version is '$version', but 'bin/feedgnuplot' says it is '$1'";
+      }
+
+      return $version;
+    }
+  }
+  die "Couldn't parse version from 'bin/feedgnuplot'";
 }
 
 sub MY::libscan
diff --git a/bin/feedgnuplot b/bin/feedgnuplot
index 224d412..4d2196a 100755
--- a/bin/feedgnuplot
+++ b/bin/feedgnuplot
@@ -12,6 +12,8 @@ use threads::shared;
 use Thread::Queue;
 use Pod::Usage;
 
+my $VERSION = 1.24;
+
 my %options;
 interpretCommandline(\%options);
 
@@ -108,7 +110,7 @@ sub interpretCommandline
              'square!', 'square_xy!', 'hardcopy=s', 'maxcurves=i', 'monotonic!',
              'histogram=s@', 'binwidth=f', 'histstyle=s',
              'terminal=s',
-             'extraValuesPerPoint=i', 'help', 'dump',
+             'extraValuesPerPoint=i', 'help', 'dump', 'version',
              'geometry=s') or pod2usage( -exitval => 1,
                                          -verbose => 1, # synopsis and args
                                          -output  => \*STDERR );
@@ -122,6 +124,12 @@ sub interpretCommandline
                -output  => \*STDOUT );
   }
 
+  if( $options->{version} )
+  {
+    print "feedgnuplot version $VERSION\n";
+    exit 0;
+  }
+
   # no global style if one isn't given
   $options->{curvestyleall} = '' unless defined $options->{curvestyleall};
 
@@ -1075,6 +1083,7 @@ As an example, if line 3 of the input is "0 9 1 20"
                        debugging.
 
   --geometry           If using X11, specifies the size, position of the plot window
+  --version            Print the version and exit
 
 =head1 ACKNOWLEDGEMENT
 

-- 
Feedgnuplot. Pipe-oriented frontend to Gnuplot.



More information about the debian-science-commits mailing list