Bugzilla – Attachment 26313 Details for
Bug 11850
Bulkmarcimport does not append in logfile
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11850: Adds a -append option to add data to the logfile
Bug-11850-Adds-a--append-option-to-add-data-to-the.patch (text/plain), 2.36 KB, created by
Magnus Enger
on 2014-03-13 15:54:29 UTC
(
hide
)
Description:
Bug 11850: Adds a -append option to add data to the logfile
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2014-03-13 15:54:29 UTC
Size:
2.36 KB
patch
obsolete
>From 8287e71711fab7611cbd90d91c26ce3852946355 Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Wed, 26 Feb 2014 16:59:14 +0100 >Subject: [PATCH] Bug 11850: Adds a -append option to add data to the logfile > >Signed-off-by: Magnus Enger <digitalutvikling@gmail.com> >Keeps current behaviour as default. >The -append option is described in the POD and works as expected. >--- > misc/migration_tools/bulkmarcimport.pl | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index 7bb6be6..c725b71 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -35,7 +35,7 @@ use open qw( :std :encoding(UTF-8) ); > binmode( STDOUT, ":encoding(UTF-8)" ); > my ( $input_marc_file, $number, $offset) = ('',0,0); > my ($version, $delete, $test_parameter, $skip_marc8_conversion, $char_encoding, $verbose, $commit, $fk_off,$format,$biblios,$authorities,$keepids,$match, $isbn_check, $logfile); >-my ( $insert, $filters, $update, $all, $yamlfile, $authtypes ); >+my ( $insert, $filters, $update, $all, $yamlfile, $authtypes, $append ); > my $cleanisbn = 1; > my ($sourcetag,$sourcesubfield,$idmapfl, $dedup_barcode); > my $framework = ''; >@@ -56,6 +56,7 @@ GetOptions( > 'fk' => \$fk_off, > 'm:s' => \$format, > 'l:s' => \$logfile, >+ 'append' => \$append, > 'k|keepids:s' => \$keepids, > 'b|biblios' => \$biblios, > 'a|authorities' => \$authorities, >@@ -76,6 +77,7 @@ GetOptions( > ); > $biblios ||= !$authorities; > $insert ||= !$update; >+my $writemode = ($append) ? "a" : "w"; > > if ($all) { > $insert = 1; >@@ -182,7 +184,7 @@ my $sth_isbn = $dbh->prepare("SELECT biblionumber,biblioitemnumber FROM biblioit > $dbh->{AutoCommit} = 0; > my $loghandle; > if ($logfile){ >- $loghandle= IO::File->new($logfile,"w") ; >+ $loghandle= IO::File->new($logfile, $writemode) ; > print $loghandle "id;operation;status\n"; > } > RECORD: while ( ) { >@@ -632,6 +634,10 @@ The I<NUMBER> of records to wait before performing a 'commit' operation > > File logs actions done for each record and their status into file > >+=item B<-append> >+ >+If specified, data will be appended to the logfile. If not, the logfile will be erased for each execution. >+ > =item B<-t, -test> > > Test mode: parses the file, saying what he would do, but doing nothing. >-- >1.8.3.2
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 11850
:
25666
|
25961
|
26022
|
26313
|
26314
|
26846