Bugzilla – Attachment 60250 Details for
Bug 18071
Add new script update_authorities.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18070: Add script for clean removal of authorities
Bug-18070-Add-script-for-clean-removal-of-authorit.patch (text/plain), 3.30 KB, created by
Marcel de Rooy
on 2017-02-15 12:52:06 UTC
(
hide
)
Description:
Bug 18070: Add script for clean removal of authorities
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-02-15 12:52:06 UTC
Size:
3.30 KB
patch
obsolete
>From 73889c79ea509fd892f5b7189292a24adedac054 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 7 Feb 2017 13:59:33 +0100 >Subject: [PATCH] Bug 18070: Add script for clean removal of authorities >Content-Type: text/plain; charset=utf-8 > >This script now supports clean removal of authority records that still >have linked biblio records. >On BZ report 18071, we will extend its functionality to include updating >001 fields, triggering a merge (refresh biblio records), etc. > >Test plan: >[1] Look for one or two authority records with linked biblio records. >[2] Pass their authority id's to the script: > perl misc/maintenance/update_authorities.pl -authid X,Y -del >[3] Verify that authority record is gone and biblio records are clean. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > misc/maintenance/update_authorities.pl | 78 ++++++++++++++++++++++++++++++++++ > 1 file changed, 78 insertions(+) > create mode 100644 misc/maintenance/update_authorities.pl > >diff --git a/misc/maintenance/update_authorities.pl b/misc/maintenance/update_authorities.pl >new file mode 100644 >index 0000000..8029271 >--- /dev/null >+++ b/misc/maintenance/update_authorities.pl >@@ -0,0 +1,78 @@ >+#!/usr/bin/perl >+ >+# Copyright Rijksmuseum 2017 >+# >+# This file is part of Koha. >+# >+# 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 3 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 Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Getopt::Long; >+use List::MoreUtils qw/uniq/; >+use Pod::Usage; >+ >+use C4::AuthoritiesMarc qw/DelAuthority merge/; >+ >+my ( @authid, $delete, $help, $verbose ); >+GetOptions( >+ 'authid:s' => \@authid, >+ 'delete' => \$delete, >+ 'help' => \$help, >+ 'verbose' => \$verbose, >+ # TODO Add more options under BZ 18071 >+); >+ >+if( $delete ) { >+ @authid = map { split /[,]/, $_; } @authid; >+ foreach my $authid ( uniq(@authid) ) { >+ DelAuthority( $authid ); # triggers a merge (read: cleanup) >+ print "Removing $authid\n" if $verbose; >+ } >+} elsif( $help ) { >+ pod2usage(1); >+} else { >+ pod2usage(1); >+} >+ >+=head1 NAME >+ >+update_authorities.pl >+ >+=head1 DESCRIPTION >+ >+Script to perform various authority related maintenance tasks. >+This version supports deleting an authority record and updating all linked >+biblio records. >+On BZ report 18071 we will add functions like: updating 001, triggering merge. >+ >+=head1 SYNOPSIS >+ >+update_authorities.pl -authid 1,2,3 -delete >+ >+update_authorities.pl -authid 1 -authid 2 -authid 3 -delete >+ >+=head1 OPTIONS >+ >+authid: List authority numbers separated by commas or repeat the >+parameter. >+ >+delete: Delete the listed authority numbers and remove its references from >+linked biblio records. >+ >+=head1 AUTHOR >+ >+Marcel de Rooy, Rijksmuseum Amsterdam, The Netherlands >+ >+=cut >-- >2.1.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 18071
:
60250
|
64743
|
64744
|
66854
|
69428
|
70310
|
70311
|
70312
|
70320
|
70388
|
70400