Bugzilla – Attachment 6361 Details for
Bug 7250
stage_biblios_file.pl is missing options for encodings, wrongly passing the MARC flavour instead
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7250: stage_biblios_file.pl is missing options for encoding
Bug-7250-stagebibliosfilepl-is-missing-options-for.patch (text/plain), 3.60 KB, created by
Katrin Fischer
on 2011-11-21 07:04:04 UTC
(
hide
)
Description:
Bug 7250: stage_biblios_file.pl is missing options for encoding
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2011-11-21 07:04:04 UTC
Size:
3.60 KB
patch
obsolete
>From d5fceb56e6be095831f33a8ede09033832ee2d00 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <Katrin.Fischer.83@web.de> >Date: Mon, 21 Nov 2011 07:54:15 +0100 >Subject: [PATCH] Bug 7250: stage_biblios_file.pl is missing options for > encoding > >- adds command line options for encoding, defaulting to utf8 >- options match options availablen in the stage marc records form > of the staff interface >- activates warnings >- adds copyright statement > >To test: >Import records with diacritics using the stage_biblios_file.pl >Records can be imported into the catalog using the staff interface >or the commit_biblios_file.pl script. >--- > misc/stage_biblios_file.pl | 35 ++++++++++++++++++++++++++++++----- > 1 files changed, 30 insertions(+), 5 deletions(-) > >diff --git a/misc/stage_biblios_file.pl b/misc/stage_biblios_file.pl >index 3f18082..6e2b30c 100755 >--- a/misc/stage_biblios_file.pl >+++ b/misc/stage_biblios_file.pl >@@ -1,7 +1,25 @@ > #!/usr/bin/perl > >+# This file is part of Koha. >+# >+# Copyright (C) 2007 LibLime >+# Parts Copyright BSZ 2011 >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 2 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with this program; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ > use strict; >-#use warnings; FIXME - Bug 2505 >+use warnings; > BEGIN { > # find Koha's Perl modules > # test carefully before changing this >@@ -17,6 +35,7 @@ use Getopt::Long; > $| = 1; > > # command-line parameters >+my $encoding = ""; > my $match_bibs = 0; > my $add_items = 0; > my $input_file = ""; >@@ -25,14 +44,19 @@ my $want_help = 0; > my $no_replace ; > > my $result = GetOptions( >+ 'encoding:s' => \$encoding, > 'file:s' => \$input_file, >- 'match-bibs:s' => \$match_bibs, >+ 'match-bibs:s' => \$match_bibs, > 'add-items' => \$add_items, > 'no-replace' => \$no_replace, > 'comment:s' => \$batch_comment, > 'h|help' => \$want_help > ); > >+if ($encoding eq "") { >+ $encoding = "utf8"; >+} >+ > if (not $result or $input_file eq "" or $want_help) { > print_usage(); > exit 0; >@@ -67,11 +91,9 @@ sub process_batch { > } > close IN; > >- my $marc_flavor = C4::Context->preference('marcflavour'); >- > print "... staging MARC records -- please wait\n"; > my ($batch_id, $num_valid, $num_items, @import_errors) = >- BatchStageMarcRecords($marc_flavor, $marc_records, $input_file, $batch_comment, '', $add_items, 0, >+ BatchStageMarcRecords($encoding, $marc_records, $input_file, $batch_comment, '', $add_items, 0, > 100, \&print_progress_and_commit); > print "... finished staging MARC records\n"; > >@@ -141,6 +163,9 @@ records into the main Koha database. > > Parameters: > --file <file_name> name of input MARC bib file >+ --encoding <encoding> encoding of MARC records, default is utf8. >+ Other possible options are: MARC-8, >+ ISO_5426, ISO_6937, ISO_8859-1, EUC-KR > --match-bibs <match_id> use this option to match bibs > in the file with bibs already in > the database for future overlay. >-- >1.7.5.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7250
:
6361
|
6374
|
6390