[Bps-public-commit] r11064 - Shipwright/trunk/lib/Shipwright/Script

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Mar 13 12:32:04 EDT 2008


Author: sunnavy
Date: Thu Mar 13 12:31:56 2008
New Revision: 11064

Modified:
   Shipwright/trunk/lib/Shipwright/Script/Build.pm
   Shipwright/trunk/lib/Shipwright/Script/Import.pm
   Shipwright/trunk/lib/Shipwright/Script/Initialize.pm
   Shipwright/trunk/lib/Shipwright/Script/Update.pm

Log:
don't overwrite foo from @_ if there already exists --foo

Modified: Shipwright/trunk/lib/Shipwright/Script/Build.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Build.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Build.pm	Thu Mar 13 12:31:56 2008
@@ -34,7 +34,8 @@
 sub run {
     my $self         = shift;
     my $install_base = shift;
-    $self->install_base($install_base) if $install_base;
+    $self->install_base($install_base)
+      if $install_base && !$self->install_base;
 
     die "need repository arg" unless $self->repository;
 

Modified: Shipwright/trunk/lib/Shipwright/Script/Import.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Import.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Import.pm	Thu Mar 13 12:31:56 2008
@@ -52,7 +52,7 @@
     my $self   = shift;
     my $source = shift;
 
-    $self->source($source) if $source;
+    $self->source($source) if $source && !$self->source;
     $self->follow(1) unless defined $self->follow;
     $self->skip( { map { $_ => 1 } split /\s*,\s*/, $self->skip || '' } );
 

Modified: Shipwright/trunk/lib/Shipwright/Script/Initialize.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Initialize.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Initialize.pm	Thu Mar 13 12:31:56 2008
@@ -28,7 +28,7 @@
 sub run {
     my $self       = shift;
     my $repository = shift;
-    $self->repository($repository) if $repository;
+    $self->repository($repository) if $repository && ! $self->repository;
     die 'need repository arg' unless $self->repository;
 
     my $shipwright = Shipwright->new(

Modified: Shipwright/trunk/lib/Shipwright/Script/Update.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Update.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Update.pm	Thu Mar 13 12:31:56 2008
@@ -40,7 +40,7 @@
     my $self = shift;
     my $name = shift;
 
-    $self->name($name) if $name;
+    $self->name($name) if $name && ! $self->name;
 
     for (qw/repository/) {
         die "need $_ arg" unless $self->$_();



More information about the Bps-public-commit mailing list