From e6a4dddb5669f0a30209b2048256b5cd927b72cc Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 23 Mar 2007 22:17:35 +0000 Subject: [PATCH] adding support for a --marctype flag, useful for supplying a MARCXML stream instead of a MARC21 file git-svn-id: svn://svn.open-ils.org/ILS/trunk@7096 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/extras/import/marc2are.pl | 10 +++++----- Open-ILS/src/extras/import/marc2bre.pl | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Open-ILS/src/extras/import/marc2are.pl b/Open-ILS/src/extras/import/marc2are.pl index 1b627d9a6b..e9abea9cd9 100755 --- a/Open-ILS/src/extras/import/marc2are.pl +++ b/Open-ILS/src/extras/import/marc2are.pl @@ -20,18 +20,18 @@ use Unicode::Normalize; use Time::HiRes qw/time/; use Getopt::Long; use MARC::Batch; -use MARC::File::XML; +use MARC::File::XML ( BinaryEncoding => 'utf-8' ); use MARC::Charset; -use UNIVERSAL::require; MARC::Charset->ignore_errors(1); -my ($utf8, $id_field, $count, $user, $password, $config, $keyfile, @files, @trash_fields) = - (0, '998', 1, 'admin', 'open-ils', '/openils/conf/bootstrap.conf'); +my ($utf8, $id_field, $count, $user, $password, $config, $marctype, $keyfile, @files, @trash_fields) = + (0, '998', 1, 'admin', 'open-ils', '/openils/conf/bootstrap.conf', 'USMARC'); GetOptions( 'startid=i' => \$count, 'user=s' => \$user, + 'marctype=s' => \$marctype, 'password=s' => \$password, 'config=s' => \$config, 'file=s' => \@files, @@ -51,7 +51,7 @@ $user = OpenILS::Application::AppUtils->check_user_session( login($user,$passwor select STDERR; $| = 1; select STDOUT; $| = 1; -my $batch = new MARC::Batch ( 'USMARC', @files ); +my $batch = new MARC::Batch ( $marctype, @files ); $batch->strict_off(); $batch->warnings_off(); diff --git a/Open-ILS/src/extras/import/marc2bre.pl b/Open-ILS/src/extras/import/marc2bre.pl index 6f9c0fa66f..203efbf493 100755 --- a/Open-ILS/src/extras/import/marc2bre.pl +++ b/Open-ILS/src/extras/import/marc2bre.pl @@ -24,16 +24,16 @@ use FileHandle; use Time::HiRes qw/time/; use Getopt::Long; use MARC::Batch; -use MARC::File::XML; -use MARC::Charset qw/utf8_to_marc8/;; -use UNIVERSAL::require; +use MARC::File::XML ( BinaryEncoding => 'utf-8' ); +use MARC::Charset; MARC::Charset->ignore_errors(1); -my ($id_field, $recid, $user, $config, $keyfile, $dontuse_file, $enc, @files, @trash_fields) = - ('', 1, 1, '/openils/conf/bootstrap.conf'); +my ($id_field, $recid, $user, $config, $marctype, $keyfile, $dontuse_file, $enc, @files, @trash_fields) = + ('', 1, 1, '/openils/conf/bootstrap.conf', 'USMARC'); GetOptions( + 'marctype=i' => \$marctype, 'startid=i' => \$recid, 'idfield=s' => \$id_field, 'user=s' => \$user, @@ -96,7 +96,7 @@ if ($dontuse_file) { select STDERR; $| = 1; select STDOUT; $| = 1; -my $batch = new MARC::Batch ( 'USMARC', @files ); +my $batch = new MARC::Batch ( $marctype, @files ); $batch->strict_off(); $batch->warnings_off(); -- 2.11.0