X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=misc%2Fmigration_tools%2Fbulkauthimport.pl;h=2709db91c9d7e851ea306814aaf646feb14d427d;hb=f76b9fb42e9ce7b90e3b45f2cc4c68470828e12a;hp=76aa6ebff64b5e85b0a2109997d2015fa72e3494;hpb=b4f39e5c5877e55baff8cfe4dba02c9475a2547e;p=koha_fer diff --git a/misc/migration_tools/bulkauthimport.pl b/misc/migration_tools/bulkauthimport.pl index 76aa6ebff6..2709db91c9 100755 --- a/misc/migration_tools/bulkauthimport.pl +++ b/misc/migration_tools/bulkauthimport.pl @@ -2,6 +2,7 @@ # small script that import an iso2709 file into koha 2.0 use strict; +#use warnings; FIXME - Bug 2505 BEGIN { # find Koha's Perl modules # test carefully before changing this @@ -27,7 +28,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, @@ -121,10 +122,10 @@ RECORD: while ( my $record = $batch->next() ) { $authtypecode="CORPO_NAME" if ($record->field('110')); $authtypecode="MEETI_NAME" if ($record->field('111')); $authtypecode="UNIF_TITLE" if ($record->field('130')); - $authtypecode="CHRON_TERM" if ($record->field('148')); - $authtypecode="TOPIC_TERM" if ($record->field('150')); - $authtypecode="GEOGR_NAME" if ($record->field('151')); - $authtypecode="GENRE/FORM" if ($record->field('155')); + $authtypecode="CHRON_TERM" if ($record->field('148') or $record->field('182')); + $authtypecode="TOPIC_TERM" if ($record->field('150') or $record->field('180')); + $authtypecode="GEOGR_NAME" if ($record->field('151') or $record->field('181')); + $authtypecode="GENRE/FORM" if ($record->field('155') or $record->field('185')); next unless $authtypecode; # skip invalid records FIXME: far too simplistic } else { @@ -144,8 +145,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";