* [Buildroot] [V2] scancpan: improve message when bad host perl version
@ 2016-06-15 17:11 Francois Perrad
2016-06-15 21:05 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Francois Perrad @ 2016-06-15 17:11 UTC (permalink / raw)
To: buildroot
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
support/scripts/scancpan | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/support/scripts/scancpan b/support/scripts/scancpan
index 6c70cfb..6d7b774 100755
--- a/support/scripts/scancpan
+++ b/support/scripts/scancpan
@@ -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,17 @@ use HTTP::Tiny;
use Safe;
use MetaCPAN::API::Tiny;
+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,
@@ -748,7 +759,7 @@ support/scripts/scancpan Try-Tiny Moo
curl -kL http://install.perlbrew.pl | bash
-perlbrew install perl-5.18.2
+perlbrew install perl-5.22.2
supports/scripts/scancpan [options] [distname ...]
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [V2] scancpan: improve message when bad host perl version
2016-06-15 17:11 [Buildroot] [V2] scancpan: improve message when bad host perl version Francois Perrad
@ 2016-06-15 21:05 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-06-15 21:05 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Jun 2016 19:11:10 +0200, Francois Perrad wrote:
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Thanks for this new version. As usual, non-trivial patches should have
a non-empty commit log. But see some comments below.
> +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
So here's you're explaining how to install perl-5.22 using perlbrew,
only when the host perl version is not sufficient. This looks good.
> +MSG
> +
> my ($help, $man, $quiet, $force, $recommend, $test, $host);
> my $target = 1;
> GetOptions( 'help|?' => \$help,
> @@ -748,7 +759,7 @@ support/scripts/scancpan Try-Tiny Moo
>
> curl -kL http://install.perlbrew.pl | bash
>
> -perlbrew install perl-5.18.2
> +perlbrew install perl-5.22.2
However, I don't understand why the help text has this information at
the beginning of it. It should IMO only be displayed when the host perl
version doesn't match the target perl version. I'm running a system
with host perl 5.22, and the help text of scancpan is somewhat
confusing. Why is it talking to be about using curl and perlbrew in the
"Usage:" section ?
Could you fix this and send an updated version? Thanks!
thomas at skate:~/projets/buildroot (master)$ ./support/scripts/scancpan
Usage:
curl -kL http://install.perlbrew.pl | bash
perlbrew install perl-5.22.2
supports/scripts/scancpan [options] [distname ...]
Options:
-help
-man
-quiet
-force
-target/-notarget
-host/-nohost
-recommend
-test
Options:
-help Prints a brief help message and exits.
-man Prints the manual page and exits.
-quiet Executes without output
-force Forces the overwriting of existing files.
-target/-notarget
Switches package generation for the target variant (the default
is "-target").
-host/-nohost
Switches package generation for the host variant (the default is
"-nohost").
-recommend
Adds *recommended* dependencies.
-test Adds dependencies for test.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-15 21:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-15 17:11 [Buildroot] [V2] scancpan: improve message when bad host perl version Francois Perrad
2016-06-15 21:05 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox