[Bps-public-commit] r17791 - in Shipwright/trunk: lib/Shipwright/Script share/bin

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Jan 16 11:52:00 EST 2009


Author: sunnavy
Date: Fri Jan 16 11:51:59 2009
New Revision: 17791

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/lib/Shipwright/Script/Build.pm
   Shipwright/trunk/share/bin/shipwright-builder

Log:
 r18835 at sunnavys-mb:  sunnavy | 2009-01-16 21:54:38 +0800
 we should check if branches first to be back compatible


Modified: Shipwright/trunk/lib/Shipwright/Script/Build.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Build.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Build.pm	Fri Jan 16 11:51:59 2009
@@ -88,11 +88,13 @@
           branches
           /
     );
-    my $branches = $shipwright->backend->branches() || {};
-    for my $name ( keys %{ $self->branches } ) {
-        confess 'no branch name ' . $self->branches->{$name} . " for $name"
-          unless grep { $_ eq $self->branches->{$name} }
-              @{ $branches->{$name} || [] };
+    my $branches = $shipwright->backend->branches();
+    if ($branches) {
+        for my $name ( keys %{ $self->branches } ) {
+            confess 'no branch name ' . $self->branches->{$name} . " for $name"
+              unless grep { $_ eq $self->branches->{$name} }
+                  @{ $branches->{$name} || [] };
+        }
     }
 
     $shipwright->backend->export( target => $shipwright->build->build_base );

Modified: Shipwright/trunk/share/bin/shipwright-builder
==============================================================================
--- Shipwright/trunk/share/bin/shipwright-builder	(original)
+++ Shipwright/trunk/share/bin/shipwright-builder	Fri Jan 16 11:51:59 2009
@@ -159,12 +159,13 @@
 
 if ( -e catfile( 'shipwright', 'branches.yml' ) ) {
     $branches =
-         ( YAML::Tiny->read( catfile( 'shipwright', 'branches.yml' ) ) )->[0]
-      || {};
-    for my $name ( keys %{ $args{branches} } ) {
-        die 'no branch name ' . $args{branches}->{$name} . " for $name"
-          unless grep { $_ eq $args{branches}->{$name} }
-              @{ $branches->{$name} || [] };
+         ( YAML::Tiny->read( catfile( 'shipwright', 'branches.yml' ) ) )->[0];
+    if ($branches) {
+        for my $name ( keys %{ $args{branches} } ) {
+            die 'no branch name ' . $args{branches}->{$name} . " for $name"
+              unless grep { $_ eq $args{branches}->{$name} }
+                  @{ $branches->{$name} || [] };
+        }
     }
 }
 



More information about the Bps-public-commit mailing list