diff mbox

[3/3] support/script/scancpan: add option test

Message ID 1412188619-3981-3-git-send-email-francois.perrad@gadz.org
State Accepted
Headers show

Commit Message

Francois Perrad Oct. 1, 2014, 6:36 p.m. UTC
test modules are usually useless on BR

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 support/scripts/scancpan | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

Comments

Thomas Petazzoni Oct. 1, 2014, 7:34 p.m. UTC | #1
Dear Francois Perrad,

On Wed,  1 Oct 2014 20:36:59 +0200, Francois Perrad wrote:
> test modules are usually useless on BR
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>

Sorry for asking only now, but can we have a real commit message that
explains what's going on?

Something like:

"""
This commit adds a new -test option to the scancpan script, which
allows to ...
"""

With your current message "test modules are usually useless on BR", I
don't understand what this option does: does it disables test modules?
does it enables it? what does it change compared to the previous
situation?

Best regards,

Thomas
Francois Perrad Oct. 3, 2014, 12:57 p.m. UTC | #2
2014-10-01 21:34 GMT+02:00 Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>:
> Dear Francois Perrad,
>
> On Wed,  1 Oct 2014 20:36:59 +0200, Francois Perrad wrote:
>> test modules are usually useless on BR
>>
>> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
>
> Sorry for asking only now, but can we have a real commit message that
> explains what's going on?
>
> Something like:
>
> """
> This commit adds a new -test option to the scancpan script, which
> allows to ...
> """
>
> With your current message "test modules are usually useless on BR", I
> don't understand what this option does: does it disables test modules?
> does it enables it? what does it change compared to the previous
> situation?
>
> Best regards,
>

find below an improved message for this patch

"""
Between Perl modules, there are 3 kinds of dependency:
 - configure/build time dependency which becomes host dependency
 - runtime dependency which becomes target dependency
 - test time dependency which is useless in a cross-compiling context like BR

Before this patch, test time dependencies are handled like runtime dependencies.

After this patch, test time dependencies are ignored by default.
The new option -test allows to add them anyway.
"""

François.


> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Thomas Petazzoni Oct. 3, 2014, 1:03 p.m. UTC | #3
Dear François Perrad,

On Fri, 3 Oct 2014 14:57:21 +0200, François Perrad wrote:

> find below an improved message for this patch
> 
> """
> Between Perl modules, there are 3 kinds of dependency:
>  - configure/build time dependency which becomes host dependency
>  - runtime dependency which becomes target dependency
>  - test time dependency which is useless in a cross-compiling context like BR
> 
> Before this patch, test time dependencies are handled like runtime dependencies.
> 
> After this patch, test time dependencies are ignored by default.
> The new option -test allows to add them anyway.
> """

Looks, much, much better. I understand now.

Thanks for the better commit message!

Thomas
Thomas Petazzoni Oct. 4, 2014, 12:44 p.m. UTC | #4
Dear Francois Perrad,

On Wed,  1 Oct 2014 20:36:59 +0200, Francois Perrad wrote:
> test modules are usually useless on BR
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
>  support/scripts/scancpan | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)

Thanks, applied, after adding your new commit message.

Thomas
diff mbox

Patch

diff --git a/support/scripts/scancpan b/support/scripts/scancpan
index f5612e3..a049e2c 100755
--- a/support/scripts/scancpan
+++ b/support/scripts/scancpan
@@ -483,7 +483,7 @@  use Module::CoreList;
 use HTTP::Tiny;
 use MetaCPAN::API::Tiny;
 
-my ($help, $man, $quiet, $force, $recommend, $host);
+my ($help, $man, $quiet, $force, $recommend, $test, $host);
 my $target = 1;
 GetOptions( 'help|?' => \$help,
             'man' => \$man,
@@ -491,7 +491,8 @@  GetOptions( 'help|?' => \$help,
             'force|f' => \$force,
             'host!' => \$host,
             'target!' => \$target,
-            'recommend' => \$recommend
+            'recommend' => \$recommend,
+            'test' => \$test
 ) or pod2usage(-exitval => 1);
 pod2usage(-exitval => 0) if $help;
 pod2usage(-exitval => 0, -verbose => 2) if $man;
@@ -554,11 +555,12 @@  sub fetch {
             next if $modname eq q{perl};
             next if $modname =~ m|^Alien|;
             next if $modname =~ m|^Win32|;
+            next if !$test && $modname =~ m|^Test|; 
             next if Module::CoreList::first_release( $modname );
             # we could use the host Module::CoreList data, because host perl and
             # target perl have the same major version
             next if ${$dep}{phase} eq q{develop};
-            next if ${$dep}{phase} eq q{test};
+            next if !$test && ${$dep}{phase} eq q{test};
             next if !$recommend && ${$dep}{relationship} ne q{requires};
             my $distname = $mcpan->module( $modname )->{distribution};
             if (${$dep}{phase} eq q{runtime}) {
@@ -716,6 +718,7 @@  supports/scripts/scancpan [options] [distname ...]
    -target/-notarget
    -host/-nohost
    -recommend
+   -test
 
 =head1 OPTIONS
 
@@ -749,6 +752,10 @@  Switches package generation for the host variant (the default is C<-nohost>).
 
 Adds I<recommended> dependencies.
 
+=item B<-test>
+
+Adds dependencies for test.
+
 =back
 
 =head1 DESCRIPTION