[Bps-public-commit] Shipwright branch, master, updated. 03c86cc93f55265adbdaa6d8c02eae530a7e696c

? sunnavy sunnavy at bestpractical.com
Mon Oct 21 11:35:25 EDT 2013


The branch, master has been updated
       via  03c86cc93f55265adbdaa6d8c02eae530a7e696c (commit)
       via  babe8990f8c2bc071b8001f859a202191ea95f3f (commit)
       via  9111106c47ed565cfca114d9572eca3fd5dab100 (commit)
      from  7a4f52d5de4c8ae112ddd594cc48e8613d49cf0c (commit)

Summary of changes:
 Changes                         |  5 ++++-
 META.yml                        |  2 +-
 lib/Shipwright.pm               |  2 +-
 lib/Shipwright/Script/Import.pm |  2 +-
 lib/Shipwright/Source/Base.pm   | 30 ++++++++++++++++++++++--------
 5 files changed, 29 insertions(+), 12 deletions(-)

- Log -----------------------------------------------------------------
commit 9111106c47ed565cfca114d9572eca3fd5dab100
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Oct 21 23:26:35 2013 +0800

    to handle special configure modules
    
    some cpan modules use other configure modules like Module::Build::Tiny, which
    we don't handle before. this commit tries to make it work as much as it can
    by reading META.yml when we can't find required meta data.

diff --git a/lib/Shipwright/Script/Import.pm b/lib/Shipwright/Script/Import.pm
index f7776bb..2a41597 100644
--- a/lib/Shipwright/Script/Import.pm
+++ b/lib/Shipwright/Script/Import.pm
@@ -327,7 +327,7 @@ sub _import_req {
         my @sources = readdir $d;
         close $d;
 
-        for my $type (qw/requires recommends build_requires test_requires/) {
+        for my $type (qw/requires configure_requires recommends build_requires test_requires/) {
             for my $module ( keys %{ $req->{$type} } ) {
                 my $dist = $map->{$module} || $module;
                 $dist =~ s/::/-/g;
diff --git a/lib/Shipwright/Source/Base.pm b/lib/Shipwright/Source/Base.pm
index adb9efa..137971d 100644
--- a/lib/Shipwright/Source/Base.pm
+++ b/lib/Shipwright/Source/Base.pm
@@ -87,7 +87,7 @@ sub _follow {
         $url = load_yaml_file( $self->url_path );
     }
 
-    my @types = qw/requires build_requires/;
+    my @types = qw/requires configure_requires/;
 
     my $reverse_map = { reverse %$map };
     my $skip_recommends = $self->skip_recommends->{ $self->name }
@@ -104,6 +104,7 @@ sub _follow {
         my $require = {};
         chdir catdir($path);
 
+        my $run_failed;
         if ( $path =~ /\bcpan-Bundle-(.*)/ ) {
             $self->log->info("$path is a CPAN Bundle distribution");
 
@@ -161,13 +162,16 @@ sub _follow {
                 1, # don't die if this fails
             );
             run_cmd( [ $^X, 'Build.PL' ] ) if $? || !-e 'Build';
-            my $source = read_file( catfile( '_build', 'prereqs' ) )
-              or confess_or_die "can't read _build/prereqs: $!";
-            my $eval = '$require = ' . $source;
-            eval "$eval;1" or confess_or_die "eval error: $@";    ## no critic
-
-            $source = read_file( catfile('Build.PL') )
-              or confess_or_die "can't read Build.PL: $!";
+            if ( -e catfile( '_build', 'prereqs' ) ) {
+                my $source = read_file( catfile( '_build', 'prereqs' ) )
+                    or confess_or_die "can't read _build/prereqs: $!";
+                my $eval = '$require = ' . $source;
+                eval "$eval;1" or confess_or_die "eval error: $@";    ## no critic
+            }
+            else {
+                # could be something else, e.g. Module::Build::Tiny
+                $run_failed = 1;
+            }
 
             run_cmd(
                 [ $^X, 'Build', 'realclean', '--allow_mb_mismatch', 1 ] );
@@ -423,7 +427,17 @@ EOF
             unlink 'Makefile.old';
         }
 
+        if ( $run_failed ) {
+            # read "require" from META.yml instead
+            my $meta = load_yaml_file('META.yml') or confess_or_die "can't read META.yml: $!";
+            for my $type ( keys %$meta ) {
+                next unless $type =~ /requires|recommends/;
+                $require->{$type} = $meta->{$type};
+            }
+        }
+
         for my $type ( @types ) {
+            next unless $require->{$type};
             for my $module ( keys %{ $require->{$type} } ) {
                 $require->{$type}{$module}{version} =
                   delete $require->{$type}{$module};

commit babe8990f8c2bc071b8001f859a202191ea95f3f
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Oct 21 23:33:15 2013 +0800

    release 2.4.34

diff --git a/Changes b/Changes
index 6e5fd85..85fa9a6 100644
--- a/Changes
+++ b/Changes
@@ -1,7 +1,8 @@
 Revision history for Shipwright
 
-2.4.34
+2.4.34 Mon Oct 21 23:26:35 2013 +0800
 
+* handle special configure modules(Module::Build::Tiny)
 
 2.4.33 Sun Sep  9 14:48:28 CST 2012
 
diff --git a/META.yml b/META.yml
index 2c105df..af232cb 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.004033
+version: 2.004034

commit 03c86cc93f55265adbdaa6d8c02eae530a7e696c
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Oct 21 23:35:03 2013 +0800

    bump to 2.4.35

diff --git a/Changes b/Changes
index 85fa9a6..e2b6fe8 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,7 @@
 Revision history for Shipwright
 
+2.4.35
+
 2.4.34 Mon Oct 21 23:26:35 2013 +0800
 
 * handle special configure modules(Module::Build::Tiny)
diff --git a/META.yml b/META.yml
index af232cb..3d69967 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.004034
+version: 2.004035
diff --git a/lib/Shipwright.pm b/lib/Shipwright.pm
index 70c86bd..f03aa0b 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.34');
+use version; our $VERSION = qv('2.4.35');
 
 use base qw/Shipwright::Base/;
 

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



More information about the Bps-public-commit mailing list