Bugzilla – Attachment 20785 Details for
Bug 7419
Add authority deduplication script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7419: quiet warnings in deduplicator
Bug-7419-quiet-warnings-in-deduplicator.patch (text/plain), 2.90 KB, created by
Jared Camins-Esakov
on 2013-09-04 19:01:49 UTC
(
hide
)
Description:
Bug 7419: quiet warnings in deduplicator
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2013-09-04 19:01:49 UTC
Size:
2.90 KB
patch
obsolete
>From 8f810f0d0dad597800bd50c1d39c043b175428d0 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Wed, 4 Sep 2013 14:17:57 -0400 >Subject: [PATCH] Bug 7419: quiet warnings in deduplicator > >Quiet some warnings from the deduplicator script. > >Revised test plan: >1) Apply patches. >2) Import the sample records (sampleauths.mrc) file into Koha and > make sure that they get indexed (by waiting until rebuild_zebra.pl > runs automatically or by running rebuild_zebra.pl -a -z [-x] manually) >3) Deduplicate based on LCCN (replace {FIRSTAUTH} with the authid of the > first imported record; on my system that number is 367123668): > > > misc/migration_tools/dedup_records.pl -t -v -a \ > -l "authid >= {FIRSTAUTH}" -r -m "lc-card/010a" -s date > >4) Check that you have 10 records that were chosen (you may have more, > if you added more authorities after importing the sample data, but you > should have at least the ten). >5) Deduplicate based on geographic heading, preferring Library of Congress > authorities to local authorities: > > > misc/migration_tools/dedup_records.pl -t -v -a \ > -l "authid >= {FIRSTAUTH}" -r -m "geographic/151a" -s "source=DLC" -s date > >6) Check that you have 2 duplicate records replaced from amongst the new > records. >7) Sign off. >--- > misc/migration_tools/dedup_records.pl | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/misc/migration_tools/dedup_records.pl b/misc/migration_tools/dedup_records.pl >index 8639a38..2a6c38b 100755 >--- a/misc/migration_tools/dedup_records.pl >+++ b/misc/migration_tools/dedup_records.pl >@@ -205,10 +205,11 @@ MARC21 only. Prefer records which come from ABC based on the 003 field. > =cut > > when (/^source=(.*)$/) { >+ my $goal = $1; > push @selectors, sub { > return ( > defined $_[0]->{'record'}->field('003') >- && $_[0]->{'record'}->field('003')->data() eq $1 >+ && $_[0]->{'record'}->field('003')->data() eq $goal > ? 1 > : 0 > ); >@@ -265,13 +266,14 @@ if ( $match =~ m#/# ) { > $matcher->threshold( 1000 * scalar(@matchers) - 1 ); > $matcher->code('TEMP'); > $matcher->description('Temporary matcher for deduplication run'); >- while ( $matchers[ $cnt++ ] =~ m#^([^/]+)/([0-9]{3})(.*)$# ) { >+ while ( $matchers[ $cnt ] && $matchers[ $cnt++ ] =~ m#^([^/]+)/([0-9]{3})(.*)$# ) { > $matcher->add_simple_matchpoint( $1, 1000, $2, $3, 0, 0, '' ); > } >+ $check ||= ''; > my @checks = split( ',', $check ); > $cnt = 0; >- while ( $checks[ $cnt++ ] =~ m#^([0-9]{3})(.*)$# ) { >- $matcher->add_simple_required_check( $1, $2, 0, 0, $1, $2, 0, 0, '' ); >+ while ( $checks[ $cnt ] && $checks[ $cnt++ ] =~ m#^([0-9]{3})(.*)$# ) { >+ $matcher->add_simple_required_check( $1, $2, 0, 0, '', $1, $2, 0, 0, '' ); > } > } > else { >-- >1.7.9.5
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 7419
:
11161
|
11162
|
11412
|
11413
|
11486
|
11487
|
11488
|
13073
|
13074
|
13629
|
13630
|
17790
|
17791
|
17792
|
18712
|
18713
|
18714
|
20783
|
20784
|
20785
|
22150
|
22907
|
25087
|
25088
|
25089
|
35886
|
35887
|
35888
|
35889
|
42972