Bugzilla – Attachment 58530 Details for
Bug 17447
Remove unused vars from batchRebuildItemsTables.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17447: Remove unused vars from batchRebuildItemsTables.pl
Bug-17447-Remove-unused-vars-from-batchRebuildItem.patch (text/plain), 2.74 KB, created by
Mark Tompsett
on 2016-12-30 15:41:28 UTC
(
hide
)
Description:
Bug 17447: Remove unused vars from batchRebuildItemsTables.pl
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2016-12-30 15:41:28 UTC
Size:
2.74 KB
patch
obsolete
>From 44f62d75b580b4ed609ed43a0f14ecde2b0c63d5 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 14 Oct 2016 14:27:15 +0200 >Subject: [PATCH] Bug 17447: Remove unused vars from batchRebuildItemsTables.pl > >Variables $extkey not used, %opt not used. >Variables $tmptest[...] not used, calling _build_tag_directory useless. >The script now does not only print help if you specify -t. >Sub defnonull tidied. >Rearranged modules, removed Dumper. > >Test plan: >[1] Run the script with -t flag. The script should not only print usage > statement, but should do a dry run. (Test this on a small database, > or pass an additional where clause.) > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > misc/batchRebuildItemsTables.pl | 23 ++++++++++++----------- > 1 file changed, 12 insertions(+), 11 deletions(-) > >diff --git a/misc/batchRebuildItemsTables.pl b/misc/batchRebuildItemsTables.pl >index eb9ce08..a18e321 100755 >--- a/misc/batchRebuildItemsTables.pl >+++ b/misc/batchRebuildItemsTables.pl >@@ -1,14 +1,16 @@ > #!/usr/bin/perl >+ > use Modern::Perl; >+ > use Getopt::Long; >+use MARC::Field; >+use MARC::Record; >+use Pod::Usage; >+use Time::HiRes qw(gettimeofday); >+ > use C4::Context; > use C4::Biblio; > use C4::Items; >-use MARC::Record; >-use MARC::Field; >-use Data::Dumper; >-use Time::HiRes qw(gettimeofday); >-use Pod::Usage; > > =head1 NAME > >@@ -41,7 +43,7 @@ GetOptions( > 'where:s' => \$where, > ) or pod2usage(2); > >-pod2usage(1) if ( $help || ( !$confirm ) ); >+pod2usage(1) if $help || ( !$confirm && !$test_parameter ); > print "### Database will not be modified ###\n" if $test_parameter; > > #dbh >@@ -68,12 +70,9 @@ $sth->execute(); > while ( my ( $biblionumber, $biblioitemnumber, $frameworkcode ) = $sth->fetchrow ) { > $count++; > warn $count unless $count % 1000; >- my $extkey; > my $record = GetMarcBiblio( $biblionumber, 1 ); > unless ($record) { push @errors, "bad record biblionumber $biblionumber"; next; } >- my ( $tmptestfields, $tmptestdirectory, $reclen, $tmptestbaseaddress ) = MARC::File::USMARC::_build_tag_directory($record); > >- #print "\n################################ record before ##################################\n".$record->as_formatted;#!test > unless ($test_parameter) { > my $rqitemnumber = $dbh->prepare("SELECT itemnumber, biblionumber from items where itemnumber = ? and biblionumber = ?"); > foreach my $itemfield ( $record->field($itemfield) ) { >@@ -109,5 +108,7 @@ if ( scalar(@errors) > 0 ) { > print "Some biblionumber could not be processed though: ", join( " ", @errors ); > } > >-sub defnonull { my $var = shift; defined $var and $var ne "" } >-__END__ >+sub defnonull { >+ my $var = shift; >+ defined $var and $var ne ""; >+} >-- >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 17447
:
56516
|
56578
|
58523
|
58524
|
58528
|
58529
|
58530
|
58531
|
58532
|
58533
|
58534
|
58537
|
58538
|
58539