Bugzilla – Attachment 4264 Details for
Bug 5579
Remove items from biblioitems.marcxml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Signed off patch -- further prettying of this script
0001-SIGNED-OFF-Bug-5579-further-fancifying-remove_items_.patch (text/plain), 2.22 KB, created by
Liz Rea
on 2011-05-26 01:52:39 UTC
(
hide
)
Description:
Signed off patch -- further prettying of this script
Filename:
MIME Type:
Creator:
Liz Rea
Created:
2011-05-26 01:52:39 UTC
Size:
2.22 KB
patch
obsolete
>From 448f134321f191aef5b7501d0815b1f670a064a5 Mon Sep 17 00:00:00 2001 >From: ruth@bywatersolutions.com <ruth@bywatersolutions.com> >Date: Tue, 24 May 2011 15:56:13 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 5579: further fancifying remove_items_from_biblioitems.pl >Content-Type: text/plain; charset="utf-8" > >This patch adds a progress indicator to remove_items_from_biblioitems.pl, with >the user option of silencing it with --silent. > >Signed-off-by: Liz Rea <lrea@nekls.org> >--- > misc/maintenance/remove_items_from_biblioitems.pl | 11 ++++++++++- > 1 files changed, 10 insertions(+), 1 deletions(-) > >diff --git a/misc/maintenance/remove_items_from_biblioitems.pl b/misc/maintenance/remove_items_from_biblioitems.pl >index 0778b29..9f30db0 100755 >--- a/misc/maintenance/remove_items_from_biblioitems.pl >+++ b/misc/maintenance/remove_items_from_biblioitems.pl >@@ -20,15 +20,17 @@ > > use strict; > use warnings; >+$|=1; > > use C4::Context; > use C4::Biblio; > use Getopt::Long; > >-my ($wherestring, $run, $want_help); >+my ($wherestring, $run, $silent, $want_help); > my $result = GetOptions( > 'where:s' => \$wherestring, > '--run' => \$run, >+ '--silent' => \$silent, > 'help|h' => \$want_help, > ); > >@@ -38,11 +40,15 @@ if ( not $result or not $run or $want_help ) { > } > > my $dbh = C4::Context->dbh; >+my $count = 0; > my $querysth = qq{SELECT biblionumber from biblioitems }; > $querysth .= " WHERE $wherestring " if ($wherestring); > my $query = $dbh->prepare($querysth); > $query->execute; > while (my $biblionumber = $query->fetchrow){ >+ $count++; >+ print "." unless $silent; >+ print "\r$count" unless ($silent or ($count % 100)); > my $record = GetMarcBiblio($biblionumber); > > if ($record) { >@@ -53,6 +59,8 @@ while (my $biblionumber = $query->fetchrow){ > } > } > >+print "\n\n$count records processed.\n" unless $silent; >+ > sub print_usage { > print <<_USAGE_; > $0: removes items from selected biblios >@@ -66,6 +74,7 @@ should be run using rebuild_zebra.pl -b -r. > Parameters: > -where use this to limit modifications to selected biblios > --run perform the update >+ --silent run silently > --help or -h show this message > _USAGE_ > } >-- >1.7.2.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 5579
:
3780
|
3797
|
3812
|
3826
| 4264