View | Details | Raw Unified | Return to bug 5600
Collapse All | Expand All

(-)a/tools/export.pl (-6 / +4 lines)
Lines 31-37 use Getopt::Long; Link Here
31
31
32
my $query = new CGI;
32
my $query = new CGI;
33
33
34
my $commandline = 0;
35
my $op;
34
my $op;
36
my $filename;
35
my $filename;
37
my $dbh         = C4::Context->dbh;
36
my $dbh         = C4::Context->dbh;
Lines 45-51 my $record_type; Link Here
45
my $help;
44
my $help;
46
45
47
# Checks if the script is called from commandline
46
# Checks if the script is called from commandline
48
if ( scalar @ARGV > 0 ) {
47
my $commandline = not defined $ENV{GATEWAY_INTERFACE};
48
49
if ( $commandline ) {
49
50
50
    # Getting parameters
51
    # Getting parameters
51
    $op = 'export';
52
    $op = 'export';
Lines 59-66 if ( scalar @ARGV > 0 ) { Link Here
59
        'record-type=s' => \$record_type,
60
        'record-type=s' => \$record_type,
60
        'help|?' => \$help
61
        'help|?' => \$help
61
    );
62
    );
62
    $commandline = 1;
63
64
63
65
    if ($help) {
64
    if ($help) {
66
        print <<_USAGE_;
65
        print <<_USAGE_;
Lines 449-455 sub getbackupfilelist { Link Here
449
    if ( opendir(my $dir, $directory) ) {
448
    if ( opendir(my $dir, $directory) ) {
450
        while (my $file = readdir($dir)) {
449
        while (my $file = readdir($dir)) {
451
            next unless ( $file =~ m/\.$extension(\.(gz|bz2|xz))?/ );
450
            next unless ( $file =~ m/\.$extension(\.(gz|bz2|xz))?/ );
452
            push @files, $file if ( -f "$backupdir/$file" && -r "$backupdir/$file" );
451
            push @files, $file if ( -f "$directory/$file" && -r "$directory/$file" );
453
        }
452
        }
454
        closedir($dir);
453
        closedir($dir);
455
    }
454
    }
456
- 

Return to bug 5600