[Bps-public-commit] Shipwright branch, master, updated. 302df288e9a51c3aff139d9873ac9ecc75f27c16

? sunnavy sunnavy at bestpractical.com
Fri Oct 25 19:57:54 EDT 2013


The branch, master has been updated
       via  302df288e9a51c3aff139d9873ac9ecc75f27c16 (commit)
       via  9343caf3e51349591ec5884b94273ba1997f3dda (commit)
       via  5757b3e5774c47d9b743ef016e2288cfaa2fc449 (commit)
       via  0f075a68a240230fa3daefed6c14070aaa5f634d (commit)
      from  5c84e77e5768ef067ed7c009fae0a6b400bed144 (commit)

Summary of changes:
 Changes                       |  7 ++++++-
 META.yml                      |  2 +-
 lib/Shipwright.pm             |  2 +-
 lib/Shipwright/Source/Base.pm | 37 ++++++++++++++++++++++++++++++++-----
 4 files changed, 40 insertions(+), 8 deletions(-)

- Log -----------------------------------------------------------------
commit 0f075a68a240230fa3daefed6c14070aaa5f634d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Oct 26 07:48:52 2013 +0800

    parse configure/build/test requires in Makefile too
    
    previously we only parsed PREREQ_PM, which is not enough nowadays.

diff --git a/lib/Shipwright/Source/Base.pm b/lib/Shipwright/Source/Base.pm
index 137971d..2720704 100644
--- a/lib/Shipwright/Source/Base.pm
+++ b/lib/Shipwright/Source/Base.pm
@@ -410,15 +410,37 @@ EOF
                 run_cmd( [ $^X, 'Makefile.PL' ] )
                   if $? || !-e 'Makefile';
 
-                my ($source) = grep { /PREREQ_PM/ } read_file('Makefile');
+                my @makefile = read_file('Makefile');
+                my ($source) = grep { /PREREQ_PM/ } @makefile;
                 if ( $source && $source =~ /({.*})/ ) {
                     my $eval .= '$require = ' . $1;
                     $eval =~ s/([\w:]+)=>/'$1'=>/g;
                     eval "$eval;1" or confess_or_die "eval error: $@";    ## no critic
+
+                    for ( keys %$require ) {
+                        $require->{requires}{$_} = delete $require->{$_};
+                    }
                 }
 
-                for ( keys %$require ) {
-                    $require->{requires}{$_} = delete $require->{$_};
+                my %requires_map = (
+                    PREREQ_PM          => 'requires',
+                    BUILD_REQUIRES     => 'build_requires',
+                    TEST_REQUIRES      => 'test_requires',
+                    CONFIGURE_REQUIRES => 'configure_requires',
+                );
+
+                for my $item ( keys %requires_map ) {
+                    my ($source) = grep { /$item/ } @makefile;
+                    if ( $source && $source =~ /({.*})/ ) {
+                        my $tmp_requires;
+                        my $eval .= '$tmp_requires = ' . $1;
+                        $eval =~ s/([\w:]+)=>/'$1'=>/g;
+                        eval "$eval;1" or confess_or_die "eval error: $@";    ## no critic
+
+                        for ( keys %$tmp_requires ) {
+                            $require->{$requires_map{$item}}{$_} = delete $tmp_requires->{$_};
+                        }
+                    }
                 }
 
             }

commit 5757b3e5774c47d9b743ef016e2288cfaa2fc449
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Oct 26 07:55:19 2013 +0800

    separate configure_requires from build_requires for M:I based packages
    
    since we have standalone configure_requiers now

diff --git a/lib/Shipwright/Source/Base.pm b/lib/Shipwright/Source/Base.pm
index 2720704..be7085e 100644
--- a/lib/Shipwright/Source/Base.pm
+++ b/lib/Shipwright/Source/Base.pm
@@ -197,8 +197,8 @@ sub _follow {
   # will omit features(..). we'll put deps in features(...) into recommends part
 
                 $makefile =~ s/^\s*requires(?!\w)/shipwright_requires/mg;
-                $makefile =~
-s/^\s*(?:build|configure)_requires(?!\w)/shipwright_build_requires/mg;
+                $makefile =~ s/^\s*build_requires(?!\w)/shipwright_build_requires/mg;
+                $makefile =~ s/^\s*configure_requires(?!\w)/shipwright_configure_requires/mg;
                 $makefile =~
                   s/^\s*test_requires(?!\w)/shipwright_test_requires/mg;
                 $makefile =~ s/^\s*recommends(?!\w)/shipwright_recommends/mg;
@@ -230,6 +230,11 @@ sub shipwright_build_requires {
     goto &build_requires;
 }
 
+sub shipwright_configure_requires {
+    _shipwright_requires( 'configure_requires', @_ == 1 ? ( @_, 0 ) : @_ );
+    goto &configure_requires;
+}
+
 sub shipwright_test_requires {
     _shipwright_requires( 'test_requires', @_ == 1 ? ( @_, 0 ) : @_ );
     goto &test_requires;

commit 9343caf3e51349591ec5884b94273ba1997f3dda
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Oct 26 07:57:08 2013 +0800

    release 2.4.36

diff --git a/Changes b/Changes
index b436861..33ff11a 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,9 @@
 Revision history for Shipwright
 
-2.4.36
+2.4.36 Sat Oct 26 07:56:06 CST 2013
+
+* separate configure_requires from build_requires for M:I based packages
+* parse configure/build/test requires in Makefile too(#89778)
 
 2.4.35 Thu Oct 24 23:46:03 CST 2013
 

commit 302df288e9a51c3aff139d9873ac9ecc75f27c16
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Oct 26 07:57:36 2013 +0800

    bump to 2.4.37

diff --git a/Changes b/Changes
index 33ff11a..8355d13 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,7 @@
 Revision history for Shipwright
 
+2.4.37
+
 2.4.36 Sat Oct 26 07:56:06 CST 2013
 
 * separate configure_requires from build_requires for M:I based packages
diff --git a/META.yml b/META.yml
index a811570..1c5708e 100644
--- a/META.yml
+++ b/META.yml
@@ -57,4 +57,4 @@ requires:
 resources:
   license: http://dev.perl.org/licenses/
   repository: git://github.com/bestpractical/shipwright.git
-version: 2.004036
+version: 2.004037
diff --git a/lib/Shipwright.pm b/lib/Shipwright.pm
index dc3722f..16b8eb5 100644
--- a/lib/Shipwright.pm
+++ b/lib/Shipwright.pm
@@ -2,7 +2,7 @@ package Shipwright;
 
 use warnings;
 use strict;
-use version; our $VERSION = qv('2.4.36');
+use version; our $VERSION = qv('2.4.37');
 
 use base qw/Shipwright::Base/;
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list