[Bps-public-commit] r17809 - in Shipwright/trunk: lib/Shipwright/Script

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sun Jan 18 07:55:17 EST 2009


Author: sunnavy
Date: Sun Jan 18 07:55:05 2009
New Revision: 17809

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

Log:
 r18881 at sunnavys-mb:  sunnavy | 2009-01-18 17:30:21 +0800
 branched source


Modified: Shipwright/trunk/lib/Shipwright/Script/Import.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Import.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Import.pm	Sun Jan 18 07:55:05 2009
@@ -56,13 +56,18 @@
         # don't have source specified, use the one in repo
         my $map        = $shipwright->backend->map    || {};
         my $source_yml = $shipwright->backend->source || {};
+        my $branches   = $shipwright->backend->branches;
 
         my $r_map = { reverse %$map };
         if ( $r_map->{ $self->name } ) {
             $source = 'cpan:' . $r_map->{ $self->name };
         }
-        elsif ( $source_yml->{ $self->name } ) {
-            $source = $source_yml->{ $self->name };
+        elsif ($branches) {
+            $source = $source_yml->{ $self->name }{ $self->as
+                  || $branches->{ $self->name }[0] };
+        }
+        else {
+            $source = $source_yml->{$self->name};
         }
 
     }
@@ -207,8 +212,13 @@
         my $new_url =
           Shipwright::Util::LoadFile( $shipwright->source->url_path )
           || {};
+        my $source_url = delete $new_url->{$name};
+
         $shipwright->backend->source(
-            Hash::Merge::merge( $shipwright->backend->source || {}, $new_url )
+            Hash::Merge::merge(
+                $shipwright->backend->source || {},
+                { $name => { $self->as || 'vendor' => $source_url } },
+            )
         );
 
         my $new_order = $shipwright->backend->fiddle_order;



More information about the Bps-public-commit mailing list