[Bps-public-commit] Shipwright branch, master, updated. 1959f30b2aa7a0d29008960a38629d29a04b3a42

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Mar 12 08:14:33 EST 2010


The branch, master has been updated
       via  1959f30b2aa7a0d29008960a38629d29a04b3a42 (commit)
      from  9cc7391981cbc410f2c9216d4d2798bb826ec0fb (commit)

Summary of changes:
 lib/Shipwright/Source/Base.pm |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 1959f30b2aa7a0d29008960a38629d29a04b3a42
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Mar 12 20:31:20 2010 +0800

    make use of META.yml if possible, as a complement

diff --git a/lib/Shipwright/Source/Base.pm b/lib/Shipwright/Source/Base.pm
index 0926670..4758b58 100644
--- a/lib/Shipwright/Source/Base.pm
+++ b/lib/Shipwright/Source/Base.pm
@@ -339,8 +339,29 @@ EOF
                   if $? || !-e 'Makefile';
                 my $prereqs = read_file( catfile('shipwright_prereqs') )
                   or confess "can't read prereqs: $!";
-                  $self->log->error( "prereqs: $prereqs" );
-                eval "$prereqs;1;" or confess "eval error: $@";    ## no critic
+                eval "$prereqs;1;" or confess "eval error: $@"; ## no critic
+
+                if ( -e 'META.yml' ) {
+
+                    # if there's META.yml, let's find more about it
+                    my $meta = Shipwright::Util::LoadFile('META.yml')
+                      or confess "can't read META.yml: $!";
+                    $require ||= {};
+                    $require->{requires} = {
+                        %{ $meta->{requires} || {} },
+                        %{ $require->{requires} || {} },
+                    };
+                    $require->{recommends} = {
+                        %{ $meta->{recommends} || {} },
+                        %{ $require->{recommends} || {} },
+                    };
+                    $require->{build_requires} = {
+                        %{ $meta->{build_requires}     || {} },
+                        %{ $meta->{configure_requires} || {} },
+                        %{ $meta->{test_requires}      || {} },
+                        %{ $require->{build_requires} || {} },
+                    };
+                }
 
                 unlink 'shipwright_makefile.pl', 'shipwright_prereqs';
             }

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



More information about the Bps-public-commit mailing list