From cc30c8bc3f53287c0cb90f7bde1ce616bf9583d2 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 10 Jan 2018 13:31:49 +0100 Subject: [PATCH] Bug 18071: (QA follow-up) Rename commit to confirm parameter Trivial edit. Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- misc/maintenance/update_authorities.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/misc/maintenance/update_authorities.pl b/misc/maintenance/update_authorities.pl index b98cafce0e..97b6cc39e9 100755 --- a/misc/maintenance/update_authorities.pl +++ b/misc/maintenance/update_authorities.pl @@ -25,10 +25,10 @@ use Pod::Usage; use C4::AuthoritiesMarc qw/AddAuthority DelAuthority GetAuthority merge/; -my ( @authid, $commit, $delete, $help, $merge, $reference, $renumber, $verbose ); +my ( @authid, $confirm, $delete, $help, $merge, $reference, $renumber, $verbose ); GetOptions( 'authid:s' => \@authid, - 'commit' => \$commit, + 'confirm' => \$confirm, 'delete' => \$delete, 'help' => \$help, 'merge' => \$merge, @@ -38,7 +38,7 @@ GetOptions( ); @authid = map { split /[,]/, $_; } @authid; -print "No changes will be made\n" unless $commit; +print "No changes will be made\n" unless $confirm; pod2usage(1) if $help; if ( $delete and $merge and $renumber ) { @@ -59,7 +59,7 @@ if( $delete ) { sub delete_auth { my ( $auths ) = @_; foreach my $authid ( uniq(@$auths) ) { - if( $commit ) { + if( $confirm ) { DelAuthority({ authid => $authid }); # triggers a merge (read: cleanup) print "Removing $authid\n" if $verbose; } else { @@ -75,7 +75,7 @@ sub merge_auth { my $marc_ref = GetAuthority( $reference ) || die "Reference record $reference not found\n"; # First update all linked biblios of reference - merge({ mergefrom => $reference, MARCfrom => $marc_ref, mergeto => $reference, MARCto => $marc_ref, override_limit => 1 }) if $commit; + merge({ mergefrom => $reference, MARCfrom => $marc_ref, mergeto => $reference, MARCto => $marc_ref, override_limit => 1 }) if $confirm; # Merge all authid's into reference my $marc; @@ -86,7 +86,7 @@ sub merge_auth { print "Authority id $authid ignored, does not exist.\n"; next; } - if( $commit ) { + if( $confirm ) { merge({ mergefrom => $authid, MARCfrom => $marc, @@ -107,7 +107,7 @@ sub renumber { foreach my $authid ( uniq(@$auths) ) { if( my $authority = Koha::Authorities->find($authid) ) { my $marc = GetAuthority( $authid ); - if( $commit ) { + if( $confirm ) { AddAuthority( $marc, $authid, $authority->authtypecode ); # AddAuthority contains an update of 001, 005 etc. print "Renumbered $authid\n" if $verbose; @@ -150,7 +150,7 @@ update_authorities.pl -c -authid 1,2,3 -renumber authid: List authority numbers separated by commas or repeat the parameter. -commit: Needed to commit changes. +confirm: Needed to commit changes. delete: Delete the listed authority numbers and remove its references from linked biblio records. -- 2.39.5