[Bps-public-commit] cpan2rt branch, deploy, created. deployed-2-g6b8962d

Thomas Sibley trs at bestpractical.com
Tue Mar 12 22:25:11 EDT 2013


The branch, deploy has been created
        at  6b8962d80bd08532ab868d11380e208362e91552 (commit)

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

    add --skip option
    (cherry picked from commit ef17b5407b8fcd6c413439cb294f1e32da4d42e8)

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 {

commit 6b8962d80bd08532ab868d11380e208362e91552
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Mar 12 17:16:40 2013 -0700

    A working --skip option to bin/cpan2rt
    
    The option was introduced in ef17b54 but didn't work correctly until
    now.
    
    Yet another reason to prefer the block form of map. :)
    (cherry picked from commit ade101e80f6ff9bfc87885fe11b35d500d45a303)

diff --git a/bin/cpan2rt b/bin/cpan2rt
index b334258..cff3165 100755
--- a/bin/cpan2rt
+++ b/bin/cpan2rt
@@ -81,7 +81,7 @@ $commands{ $command }->();
 sub cmd_update {
     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'}} };
+    $opt{'skip'} = { map { $_ => 1 } @{$opt{'skip'}} };
     my $importer = CPAN2RT->new( %opt );
 
     $importer->sync_files( $opt{'mirror'} ) if $opt{'sync'};

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



More information about the Bps-public-commit mailing list