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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Oct 2 07:27:32 EDT 2008


Author: sunnavy
Date: Thu Oct  2 07:27:31 2008
New Revision: 16192

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

Log:
 r16999 at sunnavys-mb:  sunnavy | 2008-10-02 18:40:23 +0800
 added skip-recommends and skip-all-recommends options for import


Modified: Shipwright/trunk/lib/Shipwright/Script/Import.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Import.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Import.pm	Thu Oct  2 07:27:31 2008
@@ -7,7 +7,8 @@
 use base qw/App::CLI::Command Class::Accessor::Fast Shipwright::Script/;
 __PACKAGE__->mk_accessors(
     qw/comment no_follow build_script require_yml
-      name test_script extra_tests overwrite min_perl_version skip version as/
+      name test_script extra_tests overwrite min_perl_version skip version as
+      skip_recommends skip_all_recommends/
 );
 
 use Shipwright;
@@ -23,18 +24,20 @@
 
 sub options {
     (
-        'm|comment=s'      => 'comment',
-        'name=s'           => 'name',
-        'no-follow'        => 'no_follow',
-        'build-script=s'   => 'build_script',
-        'require-yml=s'    => 'require_yml',
-        'test-script'      => 'test_script',
-        'extra-tests'      => 'extra_tests',
-        'overwrite'        => 'overwrite',
-        'min-perl-version' => 'min_perl_version',
-        'skip=s'           => 'skip',
-        'version=s'        => 'version',
-        'as=s'             => 'as',
+        'm|comment=s'         => 'comment',
+        'name=s'              => 'name',
+        'no-follow'           => 'no_follow',
+        'build-script=s'      => 'build_script',
+        'require-yml=s'       => 'require_yml',
+        'test-script'         => 'test_script',
+        'extra-tests'         => 'extra_tests',
+        'overwrite'           => 'overwrite',
+        'min-perl-version'    => 'min_perl_version',
+        'skip=s'              => 'skip',
+        'version=s'           => 'version',
+        'as=s'                => 'as',
+        'skip-recommends=s'   => 'skip_recommends',
+        'skip-all-recommends' => 'skip_all_recommends',
     );
 }
 
@@ -76,6 +79,8 @@
     }
     else {
         $self->skip( { map { $_ => 1 } split /\s*,\s*/, $self->skip || '' } );
+        $self->skip_recommends(
+            { map { $_ => 1 } split /\s*,\s*/, $self->skip_recommends || '' } );
 
         if ( $self->name ) {
             if ( $self->name =~ /::/ ) {
@@ -92,13 +97,15 @@
         }
 
         my $shipwright = Shipwright->new(
-            repository       => $self->repository,
-            source           => $source,
-            name             => $self->name,
-            follow           => !$self->no_follow,
-            min_perl_version => $self->min_perl_version,
-            skip             => $self->skip,
-            version          => $self->version,
+            repository          => $self->repository,
+            source              => $source,
+            name                => $self->name,
+            follow              => !$self->no_follow,
+            min_perl_version    => $self->min_perl_version,
+            skip                => $self->skip,
+            version             => $self->version,
+            skip_recommends     => $self->skip_recommends,
+            skip_all_recommends => $self->skip_all_recommends,
         );
 
         unless ( $self->overwrite ) {
@@ -196,7 +203,7 @@
         );
 
         my $new_order = $shipwright->backend->fiddle_order;
-        $shipwright->backend->order( $new_order );
+        $shipwright->backend->order($new_order);
     }
 
     print "imported with success\n";
@@ -402,6 +409,11 @@
                                   are already in the repository
  --version                      : specify the source's version
 
+ --skip-recommends              : specify a list of modules/dist names of
+                                  which recommends we don't want to import
+
+ --skip-all-recommends          : skip all the recommends to import
+
 =head1 DESCRIPTION
 
 The import command imports a new dist into a shipwright repository from any of



More information about the Bps-public-commit mailing list