Changeset 2795
- Timestamp:
- 2001-10-12T11:05:43+13:00 (23 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/BasPlug.pm
r2785 r2795 262 262 my $outhandle = $self->{'outhandle'}; 263 263 264 my $filename = &util::filename_cat($base_dir, $file); 264 my $filename = $file; 265 $filename = &util::filename_cat ($base_dir, $file) if $base_dir =~ /\w/; 266 265 267 if ($self->{'block_exp'} ne "" && $filename =~ /$self->{'block_exp'}/) { 266 268 $self->{'num_blocked'} ++; … … 695 697 } 696 698 697 698 699 1; -
trunk/gsdl/perllib/plugins/GMLPlug.pm
r2363 r2795 57 57 my $outhandle = $self->{'outhandle'}; 58 58 59 my $filename = &util::filename_cat($base_dir, $file); 59 my $filename = $file; 60 $filename = &util::filename_cat ($base_dir, $file) if $base_dir =~ /\w/; 61 60 62 return 0 if $self->{'block_exp'} ne "" && $filename =~ /$self->{'block_exp'}/; 61 63 if ($filename !~ /$self->{'process_exp'}/ || !-f $filename) { -
trunk/gsdl/perllib/plugins/RecPlug.pm
r2228 r2795 156 156 # Calculate the directory name and ensure it is a directory and 157 157 # that it is not explicitly blocked. 158 $file =~ s/^[\/\\]+//;159 my $dirname = &util::filename_cat ($base_dir, $file);158 my $dirname = $file; 159 $dirname = &util::filename_cat ($base_dir, $file) if $base_dir =~ /\w/; 160 160 return undef unless (-d $dirname); 161 161 return 0 if ($self->{'block_exp'} ne "" && $dirname =~ /$self->{'block_exp'}/); 162 163 162 164 163 # check to make sure we're not reading the archives or index directory -
trunk/gsdl/perllib/plugins/ZIPPlug.pm
r2785 r2795 43 43 # tar (for tar) 44 44 45 # ZIPPlug is currently disabled on windows as we can't expect any of the46 # above utilities to be present on that OS. We should probably provide47 # binaries with Greenstone some day.48 49 45 package ZIPPlug; 50 46 … … 81 77 my $outhandle = $self->{'outhandle'}; 82 78 83 # disabled on windows84 return undef if ($ENV{'GSDLOS'} =~ /^windows$/i);85 86 79 if ($file =~ /\.(gz|tgz|z|taz|bz|bz2|zip|jar|tar)$/i) { 87 80 88 my $filename = &util::filename_cat ($base_dir, $file); 81 my $filename = $file; 82 $filename = &util::filename_cat ($base_dir, $file) if $base_dir =~ /\w/; 89 83 if (!-e $filename) { 90 84 print $outhandle "ZIPPLug: WARNING: $filename does not exist\n"; … … 132 126 my $self = shift (@_); 133 127 my ($file) = @_; 128 134 129 if (system ("bunzip $file")!=0) 135 130 { … … 141 136 my $self = shift (@_); 142 137 my ($file) = @_; 138 143 139 if (system ("bunzip2 $file")!=0) 144 140 { … … 150 146 my $self = shift (@_); 151 147 my ($file) = @_; 148 152 149 system ("unzip $file"); 153 150 &util::rm ($file) if -e $file; … … 157 154 my $self = shift (@_); 158 155 my ($file) = @_; 156 159 157 system ("tar xf $file"); 160 158 &util::rm ($file) if -e $file; … … 164 162 my $self = shift (@_); 165 163 my ($file) = @_; 164 166 165 if (system ("gunzip $file")!=0) 167 166 { -
trunk/gsdl/perllib/util.pm
r2516 r2795 475 475 476 476 sub get_tmp_filename { 477 my $tmpdir = "$ENV{'GSDLHOME'}/tmp";477 my $tmpdir = filename_cat($ENV{'GSDLHOME'}, "tmp"); 478 478 &mk_all_dir ($tmpdir) unless -e $tmpdir; 479 479 480 480 my $count = 1000; 481 481 my $rand = int(rand $count); 482 while (-e "$tmpdir/F$rand") {482 while (-e &filename_cat($tmpdir, "F$rand")) { 483 483 $rand = int(rand $count); 484 484 $count++; 485 485 } 486 486 487 return "$tmpdir/F$rand";487 return filename_cat($tmpdir, "F$rand"); 488 488 } 489 489
Note:
See TracChangeset
for help on using the changeset viewer.