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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Jun 11 14:38:50 EDT 2008


Author: sunnavy
Date: Wed Jun 11 14:38:50 2008
New Revision: 13177

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

Log:
 r13237 at sunnavys-mb:  sunnavy | 2008-06-12 00:52:05 +0800
 added --with arg, only apparently


Modified: Shipwright/trunk/lib/Shipwright/Script/Build.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Build.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Build.pm	Wed Jun 11 14:38:50 2008
@@ -7,7 +7,7 @@
 use base qw/App::CLI::Command Class::Accessor::Fast Shipwright::Script/;
 __PACKAGE__->mk_accessors(
     qw/repository log_level install_base build_base skip skip_test only_test
-      force log_file flags name perl only/
+      force log_file flags name perl only with/
 );
 
 use Shipwright;
@@ -28,6 +28,7 @@
         'only-test'      => 'only_test',
         'force'          => 'force',
         'perl'           => 'perl',
+        'with=s'         => 'with',
     );
 }
 
@@ -65,6 +66,8 @@
         }
     );
 
+    $self->with( { map { split /=/ } split /\s*,\s*/, $self->with || '' } );
+
     my $shipwright = Shipwright->new(
         map { $_ => $self->$_ }
           qw/repository log_level log_file skip skip_test
@@ -104,3 +107,6 @@
  --name NAME                  : specify the name of the project
  --perl PATH                  : specify the path of perl that run the commands
                                 in scripts/
+ --with name=source,...       : don't build the dist of the name in repo,
+                                use the one specified here instead.
+

Modified: Shipwright/trunk/share/bin/shipwright-builder
==============================================================================
--- Shipwright/trunk/share/bin/shipwright-builder	(original)
+++ Shipwright/trunk/share/bin/shipwright-builder	Wed Jun 11 14:38:50 2008
@@ -23,7 +23,8 @@
     'skip-test-except-final', 'only-test',
     'force',                  'clean',
     'name=s',                 'help',
-    'noclean',                'only=s'
+    'noclean',                'only=s',
+    'with=s',
   );
 
 my $USAGE = <<'END'
@@ -69,6 +70,10 @@
 
 noclean: don't clean before build
 
+with: don't build the dist in repo, use the one specified here instead.
+    e.g. --with svn=dir:/home/foo/svn
+    'svn' is the dist name, 'dir:/home/foo/svn' is its source, with the format of Shipwright::Source
+
 END
   ;
 
@@ -83,6 +88,8 @@
     map { $_ => 1 } split /\s*,\s*/, $args{flags} || ''
 };
 
+$args{with} = { map { split /=/ } split /\s*,\s*/, $args{with} || '' };
+
 if ( $args{only} ) {
     $args{only} = { map { $_ => 1 } split /\s*,\s*/, $args{only} };
 }
@@ -99,10 +106,10 @@
 
 # fill not specified but mandatary flags
 if ( $flags->{__mandatary} ) {
-    for my $list ( values %{$flags->{__mandatary}} ) {
+    for my $list ( values %{ $flags->{__mandatary} } ) {
         next unless @$list;
         next if grep { $args{flags}{$_} } @$list;
-        $args{flags}{$list->[0]}++;
+        $args{flags}{ $list->[0] }++;
     }
 }
 



More information about the Bps-public-commit mailing list