[Bps-public-commit] r9952 - bpsbuilder/BPB/lib/BPB/Source

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Dec 14 09:45:01 EST 2007


Author: sunnavy
Date: Fri Dec 14 09:45:01 2007
New Revision: 9952

Modified:
   bpsbuilder/BPB/lib/BPB/Source/Base.pm

Log:
check META.yml's existence before load, also check skip item's existence

Modified: bpsbuilder/BPB/lib/BPB/Source/Base.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Source/Base.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Source/Base.pm	Fri Dec 14 09:45:01 2007
@@ -54,8 +54,11 @@
     # if not found, we'll create one according to META.yml
     if ( !-e $require_path ) {
         my $meta_path = File::Spec->catfile( $path, 'META.yml' );
-        my $meta      = BPB::Config::LoadFile($meta_path);
-        my $require   = $meta->{requires};
+        my $require = {};
+        if ( -e $meta_path ) {
+            my $meta = BPB::Config::LoadFile($meta_path);
+            $require = $meta->{requires};
+        }
         BPB::Config::DumpFile( $require_path, $require );
     }
 
@@ -122,8 +125,10 @@
     my $self   = shift;
     my $module = shift;
 
-    for ( @{ $self->skip } ) {
-        return 1 if $module =~ /$_/;
+    if ( $self->skip ) {
+        for ( @{ $self->skip } ) {
+            return 1 if $module =~ /$_/;
+        }
     }
 
     return;



More information about the Bps-public-commit mailing list