Bugzilla – Attachment 100920 Details for
Bug 21865
Add Elasticsearch support to, and improve verbose output of, `remove_unused_authorities.pl`
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21865: add confirm to remove_unused_authorities.pl script
Bug-21865-add-confirm-to-removeunusedauthoritiespl.patch (text/plain), 2.17 KB, created by
Bernardo Gonzalez Kriegel
on 2020-03-17 17:15:48 UTC
(
hide
)
Description:
Bug 21865: add confirm to remove_unused_authorities.pl script
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2020-03-17 17:15:48 UTC
Size:
2.17 KB
patch
obsolete
>From ed8683165b8e38ece09251fd4b248e89f3c003cf Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Mon, 19 Nov 2018 15:45:49 +0100 >Subject: [PATCH] Bug 21865: add confirm to remove_unused_authorities.pl script > >Like in most scripts in misc, add confirm argument >to ensure script is not run without knowing what it does. > >Test plan: >1) Run misc/migration_tools/remove_unused_authorities.pl -h >2) You see help line for confirm >3) Run misc/migration_tools/remove_unused_authorities.pl >4) You see help and script does nothing >5) Run misc/migration_tools/remove_unused_authorities.pl -c >6) Script runs like wanted > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >--- > misc/migration_tools/remove_unused_authorities.pl | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > >diff --git a/misc/migration_tools/remove_unused_authorities.pl b/misc/migration_tools/remove_unused_authorities.pl >index 30acf5df98..00869a9b28 100755 >--- a/misc/migration_tools/remove_unused_authorities.pl >+++ b/misc/migration_tools/remove_unused_authorities.pl >@@ -30,15 +30,15 @@ use Getopt::Long; > use Koha::SearchEngine::Search; > > my @authtypes; >-my $want_help = 0; >-my $test = 0; >+my ($confirm, $test, $want_help); > GetOptions( > 'aut|authtypecode:s' => \@authtypes, >+ 'c|confirm' => \$confirm, > 't|test' => \$test, >- 'h|help' => \$want_help >+ 'h|help' => \$want_help, > ); > >-if ($want_help) { >+if ( $want_help || !$confirm ) { > print_usage(); > exit 0; > } >@@ -129,11 +129,14 @@ particular type will be checked for usage. --aut can be repeated. > > If --aut is not supplied, all authority records will be checked. > >+Use --confirm Confirms you want to really run this script, otherwise prints this help. >+ > Use --test to perform a test run. This script does not ask the > operator to confirm the deletion of each authority record. > > parameters > --aut|authtypecode TYPE the list of authtypes to check >+ --confirm or -c confirm running of script > --test or -t test mode, don't delete really, just count > --help or -h show this message. > >-- >2.17.1
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 21865
:
82558
|
82559
|
82560
|
100577
|
100918
|
100919
|
100920
|
100921
|
102836
|
102837
|
102838
|
102839