[Koha-patches] [PATCH] Fixes command-line 'number' arg in bulkauthimport.pl.

Mason James mason.loves.sushi at gmail.com
Fri Jan 16 11:07:12 CET 2009


for HEAD and 3.0.x

---
 misc/migration_tools/bulkauthimport.pl |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/misc/migration_tools/bulkauthimport.pl b/misc/migration_tools/bulkauthimport.pl
index 76aa6eb..e9d1e83 100755
--- a/misc/migration_tools/bulkauthimport.pl
+++ b/misc/migration_tools/bulkauthimport.pl
@@ -27,7 +27,7 @@ my ($version, $delete, $test_parameter,$char_encoding, $verbose, $format, $commi
 $| = 1;
 GetOptions(
     'file:s'    => \$input_marc_file,
-    'n' => \$number,
+    'n:i' => \$number,
     'h' => \$version,
     'd' => \$delete,
     't' => \$test_parameter,
@@ -144,8 +144,10 @@ RECORD: while ( my $record = $batch->next() ) {
         warn "ADDED authority NB $authid in DB\n" if $verbose;
         $dbh->commit() if (0 == $i % $commitnum);
     }
+
+    last if $i ==  $number;
 }
 $dbh->commit();
 
 my $timeneeded = gettimeofday - $starttime;
-print "$i MARC record done in $timeneeded seconds\n";
+print "\n$i MARC record done in $timeneeded seconds\n";
-- 
1.5.6.5




More information about the Koha-patches mailing list