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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Nov 10 04:24:59 EST 2008


Author: sunnavy
Date: Mon Nov 10 04:24:58 2008
New Revision: 16801

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

Log:
 r17685 at sunnavys-mb:  sunnavy | 2008-11-10 16:53:11 +0800
 call import cmd if not given --only-sources arg: it is ugly, but it works for now. need refacotr


Modified: Shipwright/trunk/lib/Shipwright/Script/Update.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Update.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Update.pm	Mon Nov 10 04:24:58 2008
@@ -5,7 +5,7 @@
 use Carp;
 
 use base qw/App::CLI::Command Class::Accessor::Fast Shipwright::Script/;
-__PACKAGE__->mk_accessors(qw/all follow builder utility version/);
+__PACKAGE__->mk_accessors(qw/all follow builder utility version only_sources/);
 
 use Shipwright;
 use File::Spec::Functions qw/catdir/;
@@ -19,11 +19,12 @@
 
 sub options {
     (
-        'a|all'     => 'all',
-        'follow'    => 'follow',
-        'builder'   => 'builder',
-        'utility'   => 'utility',
-        'version=s' => 'version',
+        'a|all'        => 'all',
+        'follow'       => 'follow',
+        'builder'      => 'builder',
+        'utility'      => 'utility',
+        'version=s'    => 'version',
+        'only-sources' => 'only_sources',
     );
 }
 
@@ -81,11 +82,29 @@
             }
 
             for (@dists) {
-                if ( $_ eq $name ) {
-                    $self->_update( $_, $self->version );
+                if ( $self->only_sources ) {
+                    if ( $_ eq $name ) {
+                        $self->_update( $_, $self->version );
+                    }
+                    else {
+                        $self->_update($_);
+                    }
                 }
                 else {
-                    $self->_update($_);
+                    system(
+                        "$0 import -r " . $self->repository
+                        . (
+                            $self->log_level
+                            ? ( " --log-level " . $self->log_level )
+                            : ''
+                          )
+                          . (
+                            $self->log_file
+                            ? ( " --log-file " . $self->log_file )
+                            : ''
+                          )
+                          . " --name $_"
+                    );
                 }
             }
         }
@@ -148,7 +167,6 @@
         overwrite => 1,
         version   => $version->{$name},
     );
-
 }
 
 1;



More information about the Bps-public-commit mailing list