]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
scancpan: improve message when bad host perl version
authorFrancois Perrad <fperrad@gmail.com>
Thu, 16 Jun 2016 16:26:24 +0000 (18:26 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 4 Jul 2016 15:41:54 +0000 (17:41 +0200)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
[Thomas:
 - add comment in scancpan about the version dependency, suggested by
   Yann E. Morin.
 - add comment in perl.mk about the need to sync any version change with
   scancpan, also suggested by Yann E. Morin.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/perl/perl.mk
support/scripts/scancpan

index d66e4487c1f7923bb0fb9a04353082e210b73a4b..f96b6382460b56ffea716e86a2ef561b7b28ee06 100644 (file)
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# When updating the version here, also update support/scripts/scancpan
 PERL_VERSION_MAJOR = 22
 PERL_VERSION = 5.$(PERL_VERSION_MAJOR).2
 PERL_SITE = http://www.cpan.org/src/5.0
index 6c70cfba8a4accdd601a61af5c3b9e617a8e52bb..3ee543a31fb9e1840b3a3e8ad4656e18887e6cfc 100755 (executable)
@@ -471,7 +471,7 @@ unshift @INC, sub {
 } # END OF FATPACK CODE
 
 
-use 5.022;      # same major version as target perl
+use 5.010;
 use strict;
 use warnings;
 use Fatal qw(open close);
@@ -484,6 +484,19 @@ use HTTP::Tiny;
 use Safe;
 use MetaCPAN::API::Tiny;
 
+# Below, 5.022 should be aligned with the version of perl actually
+# bundled in Buildroot:
+die <<"MSG" if $] < 5.022;
+This script needs a host perl with the same major version as Buildroot target perl.
+
+Your current host perl is:
+    $^X
+    version $]
+
+You may install a local one by running:
+    perlbrew install perl-5.22.2
+MSG
+
 my ($help, $man, $quiet, $force, $recommend, $test, $host);
 my $target = 1;
 GetOptions( 'help|?' => \$help,
@@ -746,10 +759,6 @@ support/scripts/scancpan Try-Tiny Moo
 
 =head1 SYNOPSIS
 
-curl -kL http://install.perlbrew.pl | bash
-
-perlbrew install perl-5.18.2
-
 supports/scripts/scancpan [options] [distname ...]
 
  Options: