From 82a658412aa00e567f461c69bf2b5ee8f4f10254 Mon Sep 17 00:00:00 2001
From: Vincent Danjean <Vincent.Danjean@ens-lyon.org>
Date: Sat, 3 Nov 2012 14:02:30 +0100
Subject: [PATCH] Cleanup version handling

---
 ALTree/Chi2.pm   | 4 ++--
 ALTree/Import.pm | 4 ++--
 Makefile.PL      | 3 ++-
 progs/altree     | 7 ++-----
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/ALTree/Chi2.pm b/ALTree/Chi2.pm
index 858b150..40b130a 100644
--- a/ALTree/Chi2.pm
+++ b/ALTree/Chi2.pm
@@ -10,8 +10,8 @@ BEGIN {
     # set the version for version checking
     #$VERSION     = 1.00;
     # if using RCS/CVS, this may be preferred
-    $VERSION = do { my @r = (q$Revision$ =~ /\d+/g); 
-		    sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
+    #$VERSION = do { my @r = (q$Revision$ =~ /\d+/g); 
+    #		    sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
     
     @ISA         = qw(Exporter);
     @EXPORT      = qw(NON_SIGNIFICATIF SIGNIFICATIF &chi2_significatif &definition_p_chi2 &reech_chi2);
diff --git a/ALTree/Import.pm b/ALTree/Import.pm
index a64a444..1485749 100644
--- a/ALTree/Import.pm
+++ b/ALTree/Import.pm
@@ -18,8 +18,8 @@ BEGIN {
     # set the version for version checking
     #$VERSION     = 1.00;
     # if using RCS/CVS, this may be preferred
-    $VERSION = do { my @r = (q$Revision$ =~ /\d+/g); 
-		    sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
+    #$VERSION = do { my @r = (q$Revision$ =~ /\d+/g); 
+    #		    sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
     
     @ISA         = qw(Exporter);
     @EXPORT      = qw();
diff --git a/Makefile.PL b/Makefile.PL
index 8e8e3c5..72286b2 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,7 +6,8 @@ WriteMakefile(
     NAME              => 'altree',
     PMLIBDIRS         => [ 'ALTree' ],
     DIR               => [ 'CUtils' ],
-    VERSION	      => '1.2.1',
+    VERSION_FROM      => 'progs/altree',
+    depend	      => { Makefile => '$(VERSION_FROM)' },
     LICENSE           => 'perl',
     PREREQ_PM         => {}, # e.g., Module::Name => 1.1
     ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
diff --git a/progs/altree b/progs/altree
index 834100e..2ef1b54 100755
--- a/progs/altree
+++ b/progs/altree
@@ -10,8 +10,7 @@ use Data::Dumper;
 
 srand(654321);
 
-our $VERSION;
-$VERSION = sprintf "0.%03d", q$Revision: 433 $ =~ /(\d+)/g;
+use version; our $VERSION = qv(1.2.1);
 
 # Positionner la variable PERL5LIB si besoin
 
@@ -1195,9 +1194,7 @@ sub manage_options
 		) or pod2usage(2);
     if (defined($options{"version"})) {
 	print $0, " version ", $VERSION, "\n";
-	print "(CUtils version ", $ALTree::CUtils::VERSION, 
-	"; chi2.pm version ", $ALTree::Chi2::VERSION,
-	"; Perl version ", $], ")\n";
+	print "(Perl version ", $], ")\n";
 	exit 0;
     }
     if (defined($options{"short-help"})) {
-- 
GitLab