From fc02ce517b784458c8669e3c8dad40361b9342c5 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 15 Oct 2008 21:36:06 +0200 Subject: [PATCH] merge_authority : Bug fixing Signed-off-by: Henri-Damien LAURENT --- misc/migration_tools/merge_authority.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/migration_tools/merge_authority.pl b/misc/migration_tools/merge_authority.pl index 6345c9dff8..b5e64f61ad 100755 --- a/misc/migration_tools/merge_authority.pl +++ b/misc/migration_tools/merge_authority.pl @@ -27,7 +27,7 @@ GetOptions( 'b' => \$batch, ); -if ($version || ($mergefrom eq '')) { +if ($version || ($mergefrom eq '' && !$batch)) { print <dbh; -# my @subf = $subfields =~ /(##\d\d\d##.)/g; $|=1; # flushes output my $authfrom = GetAuthority($mergefrom); @@ -58,7 +57,7 @@ my $authto = GetAuthority($mergeto); my $authtypecodefrom = GetAuthTypeCode($mergefrom); my $authtypecodeto = GetAuthTypeCode($mergeto); -unless ($noconfirm) { +unless ($noconfirm || $batch) { print "************\n"; print "You will merge authority : $mergefrom ($authtypecodefrom)\n".$authfrom->as_formatted; print "\n*************\n"; @@ -85,7 +84,8 @@ if ($batch) { if ($authid =~ /\.authid$/) { $authid =~ s/\.authid$//; print "managing $authid\n" if $verbose; - my $MARCauth = GetAuthority($authid); + my $MARCauth = GetAuthority($authid) ; + next unless ($MARCauth); merge($authid,$MARCauth,$authid,$MARCauth) if ($MARCauth); unlink $cgidir.'/localfile/modified_authorities/'.$authid.'.authid'; } -- 2.39.5