|
Lines 12-17
use Getopt::Long;
Link Here
|
| 12 |
use YAML; |
12 |
use YAML; |
| 13 |
use List::MoreUtils qw/uniq/; |
13 |
use List::MoreUtils qw/uniq/; |
| 14 |
|
14 |
|
|
|
15 |
=head1 NAME |
| 16 |
|
| 17 |
misc/migration_tools/dedup_authorities.pl - Deduping authorities script |
| 18 |
|
| 19 |
=head1 DESCRIPTION |
| 20 |
|
| 21 |
Use this script to remove duplicate authorities. |
| 22 |
|
| 23 |
=cut |
| 24 |
|
| 15 |
my @matchstrings; |
25 |
my @matchstrings; |
| 16 |
my $choosemethod = "u"; # by default, choose to keep the most used authority |
26 |
my $choosemethod = "u"; # by default, choose to keep the most used authority |
| 17 |
my ($verbose, $all, $help, $wherestring, $test); |
27 |
my ($verbose, $all, $help, $wherestring, $test); |
|
Lines 426-438
sub _is_duplicate {
Link Here
|
| 426 |
warn "no or bad authoritytypecode for $authid1"; |
436 |
warn "no or bad authoritytypecode for $authid1"; |
| 427 |
return 0; |
437 |
return 0; |
| 428 |
} |
438 |
} |
| 429 |
my $auth_tag = $authtypes{$at1} if (exists $authtypes{$at1}); |
439 |
my $auth_tag = exists $authtypes{$at1} ? $authtypes{$at1} : ''; |
| 430 |
my $at2 = GetAuthTypeCode($authid2); |
440 |
my $at2 = GetAuthTypeCode($authid2); |
| 431 |
if (!$at2){ |
441 |
if (!$at2){ |
| 432 |
warn "no or bad authoritytypecode for $authid2"; |
442 |
warn "no or bad authoritytypecode for $authid2"; |
| 433 |
return 0; |
443 |
return 0; |
| 434 |
} |
444 |
} |
| 435 |
my $auth_tag2 = $authtypes{$at2} if (exists $authtypes{$at2}); |
445 |
my $auth_tag2 = exists $authtypes{$at2} ? $authtypes{$at2} : ''; |
| 436 |
$debug and warn YAML::Dump($authrecord); |
446 |
$debug and warn YAML::Dump($authrecord); |
| 437 |
$debug and warn YAML::Dump($marc); |
447 |
$debug and warn YAML::Dump($marc); |
| 438 |
SetUTF8Flag($authrecord); |
448 |
SetUTF8Flag($authrecord); |
| 439 |
- |
|
|