Bug 8742 - Example uses perl 5.8 in Makefile.PL
authorMark Tompsett <mtompset@hotmail.com>
Tue, 11 Sep 2012 17:25:59 +0000 (01:25 +0800)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 10 Oct 2012 15:03:25 +0000 (17:03 +0200)
Changed hardcoded path for a programmatic one. Basing it on:
  grep /\/usr\/share\/perl\//, @INC;
And doing a:
  push @version, ('/usr/share/perl/5.10') if !$version[0];
For a reasonable default otherwise. No more references to
  /usr/share/perl/5.8
hardcoded into the output.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

Makefile.PL

index 46a3524..b6ca640 100644 (file)
@@ -1358,6 +1358,8 @@ sub _add_destdir {
 sub display_configuration {
     my $config = shift;
     my $dirmap = shift;
+    my @version = grep /\/usr\/share\/perl\//, @INC;
+    push @version, ('/usr/share/perl/5.10') if !$version[0];
     print "\n\nKoha will be installed with the following configuration parameters:\n\n";
     foreach my $key (sort keys %$config) {
         print sprintf("%-25.25s%s\n", $key, $config->{$key});
@@ -1370,7 +1372,7 @@ sub display_configuration {
     print "\n\nTo change any configuration setting, please run\n";
     print "perl Makefile.PL again.  To override one of the target\n";
     print "directories, you can do so on the command line like this:\n";
-    print "\nperl Makefile.PL PERL_MODULE_DIR=/usr/share/perl/5.8\n\n";
+    print "\nperl Makefile.PL PERL_MODULE_DIR=$version[0]\n\n";
     print "You can also set different default values for parameters\n";
     print "or override directory locations by using environment variables.\n";
     print "\nFor example:\n\n";