Bugzilla – Attachment 11331 Details for
Bug 5600
Bulk MARC biblio export script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5600 follow-up: Fix commandline check in order to work under Plack
0002-Bug-5600-follow-up-Fix-commandline-check-in-order-to.patch (text/plain), 1.69 KB, created by
Julian Maurice
on 2012-08-03 14:32:27 UTC
(
hide
)
Description:
Bug 5600 follow-up: Fix commandline check in order to work under Plack
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2012-08-03 14:32:27 UTC
Size:
1.69 KB
patch
obsolete
>From a22c33950daecf9061a5da8ceaf6ac0f8030accb Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 3 Aug 2012 16:26:34 +0200 >Subject: [PATCH 2/2] Bug 5600 follow-up: Fix commandline check in order to > work under Plack > >With plackup, @ARGV can contains elements so we can't check the size of >@ARGV to tell whether we are in command line mode or not. >Instead we check environment variable GATEWAY_INTERFACE. > >Also fix the use of a global variable in a subroutine >--- > tools/export.pl | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > >diff --git a/tools/export.pl b/tools/export.pl >index c075b25..003a9c7 100755 >--- a/tools/export.pl >+++ b/tools/export.pl >@@ -31,7 +31,6 @@ use Getopt::Long; > > my $query = new CGI; > >-my $commandline = 0; > my $op; > my $filename; > my $dbh = C4::Context->dbh; >@@ -45,7 +44,9 @@ my $record_type; > my $help; > > # Checks if the script is called from commandline >-if ( scalar @ARGV > 0 ) { >+my $commandline = not defined $ENV{GATEWAY_INTERFACE}; >+ >+if ( $commandline ) { > > # Getting parameters > $op = 'export'; >@@ -59,8 +60,6 @@ if ( scalar @ARGV > 0 ) { > 'record-type=s' => \$record_type, > 'help|?' => \$help > ); >- $commandline = 1; >- > > if ($help) { > print <<_USAGE_; >@@ -449,7 +448,7 @@ sub getbackupfilelist { > if ( opendir(my $dir, $directory) ) { > while (my $file = readdir($dir)) { > next unless ( $file =~ m/\.$extension(\.(gz|bz2|xz))?/ ); >- push @files, $file if ( -f "$backupdir/$file" && -r "$backupdir/$file" ); >+ push @files, $file if ( -f "$directory/$file" && -r "$directory/$file" ); > } > closedir($dir); > } >-- >1.7.10.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 5600
:
9955
|
10200
|
10671
|
10676
|
10954
|
10997
|
11099
| 11331 |
11334