[Bps-public-commit] cpan2rt branch, master, updated. ef17b5407b8fcd6c413439cb294f1e32da4d42e8

Ruslan Zakirov ruz at bestpractical.com
Fri May 27 17:50:52 EDT 2011


The branch, master has been updated
       via  ef17b5407b8fcd6c413439cb294f1e32da4d42e8 (commit)
      from  3a35d83c09f4e4951c60860766346ae3fe63d589 (commit)

Summary of changes:
 bin/cpan2rt |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit ef17b5407b8fcd6c413439cb294f1e32da4d42e8
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Mon Jan 10 00:39:41 2011 +0300

    add --skip option

diff --git a/bin/cpan2rt b/bin/cpan2rt
index b800248..b334258 100755
--- a/bin/cpan2rt
+++ b/bin/cpan2rt
@@ -79,16 +79,16 @@ unless ( $command ) {
 $commands{ $command }->();
 
 sub cmd_update {
-    my %opt = ( sync => 1, force => 0, debug => 0 );
-    GetOptions( \%opt, 'sync!', 'force!', 'debug!', 'home=s', 'datadir=s', 'mirror=s' );
-
+    my %opt = ( sync => 1, force => 0, debug => 0, skip => [] );
+    GetOptions( \%opt, 'sync!', 'force!', 'debug!', 'home=s', 'datadir=s', 'mirror=s', 'skip=s@' );
+    $opt{'skip'} = { map $_ => 1, @{$opt{'skip'}} };
     my $importer = CPAN2RT->new( %opt );
 
     $importer->sync_files( $opt{'mirror'} ) if $opt{'sync'};
-    $importer->sync_authors( $opt{'force'} );
-    $importer->sync_distributions( $opt{'force'} );
-    $importer->sync_versions( $opt{'force'} );
-    $importer->sync_maintainers( $opt{'force'} );
+    $importer->sync_authors( $opt{'force'} ) unless $opt{'skip'}{'authors'};
+    $importer->sync_distributions( $opt{'force'} ) unless $opt{'skip'}{'distributions'};
+    $importer->sync_versions( $opt{'force'} ) unless $opt{'skip'}{'versions'};
+    $importer->sync_maintainers( $opt{'force'} ) unless $opt{'skip'}{'maintainers'};
 }
 
 sub usage {

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list