[Bps-public-commit] r13716 - in Shipwright/trunk: .

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Jul 1 11:45:51 EDT 2008


Author: sunnavy
Date: Tue Jul  1 11:45:51 2008
New Revision: 13716

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/lib/Shipwright/Build.pm

Log:
 r13988 at sunnavys-mb:  sunnavy | 2008-07-01 23:45:05 +0800
 back compatible change: sometimes there are no flags.yml or ktf.yml


Modified: Shipwright/trunk/lib/Shipwright/Build.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Build.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Build.pm	Tue Jul  1 11:45:51 2008
@@ -104,7 +104,7 @@
         $installed_file =
           File::Spec->catfile( $self->install_base, 'installed.yml' );
         if ( -e $installed_file ) {
-            $installed = Shipwright::Util::LoadFile( $installed_file );
+            $installed = Shipwright::Util::LoadFile($installed_file);
             $installed_hash = { map { $_ => 1 } @$installed };
         }
         else {
@@ -116,13 +116,11 @@
             File::Spec->catfile( 'shipwright', 'order.yml' ) )
           || [];
 
-        my $flags;
+        my ( $flags, $ktf );
         if ( -e File::Spec->catfile( 'shipwright', 'flags.yml' ) ) {
 
-            $flags =
-              Shipwright::Util::LoadFile(
-                File::Spec->catfile( 'shipwright', 'flags.yml' ) )
-              || {};
+            $flags = Shipwright::Util::LoadFile(
+                File::Spec->catfile( 'shipwright', 'flags.yml' ) );
 
             # fill not specified but mandatory flags
             if ( $flags->{__mandatory} ) {
@@ -133,11 +131,18 @@
                 }
             }
         }
+        else {
+            $flags = {};
+        }
 
-        my $ktf =
-          Shipwright::Util::LoadFile(
-            File::Spec->catfile( 'shipwright', 'ktf.yml' ) )
-          || {};
+        if ( -e File::Spec->catfile( 'shipwright', 'ktf.yml' ) ) {
+
+            $ktf = Shipwright::Util::LoadFile(
+                File::Spec->catfile( 'shipwright', 'ktf.yml' ) );
+        }
+        else {
+            $ktf = {};
+        }
 
         # calculate the real order
         if ( $self->only ) {
@@ -173,7 +178,7 @@
 
         for my $dist (@$order) {
             $self->_install( $dist, $ktf );
-            $self->_record( $dist );
+            $self->_record($dist);
             chdir $self->build_base;
         }
 
@@ -387,8 +392,7 @@
     }
 }
 
-
-# record the installed dist, so we don't need to installed it later 
+# record the installed dist, so we don't need to installed it later
 # if at the same install_base
 
 sub _record {



More information about the Bps-public-commit mailing list