Ignore:
Timestamp:
2013-07-22T15:07:19+12:00 (11 years ago)
Author:
ak19
Message:
  1. Reference to undefined variable. 2. Using FileUtils:: subroutines in place of deprecated utils:: ones.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/ZIPPlugin.pm

    r25508 r27916  
    4949use plugin;
    5050use util;
     51use FileUtils;
    5152use Cwd;
    5253
     
    131132    $tmpdir =~ s/\.[^\.]*//;
    132133    $tmpdir = &util::rename_file($tmpdir, $self->{'file_rename_method'});
    133     $tmpdir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "tmp", $tmpdir);
    134     &util::mk_all_dir ($tmpdir);
     134    $tmpdir = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'}, "tmp", $tmpdir);
     135    &FileUtils::makeAllDirectories() ($tmpdir);
    135136   
    136137    print $outhandle "ZIPPlugin: extracting $filename_no_path to $tmpdir\n"
     
    140141    my $cwd = cwd();
    141142    chdir ($tmpdir) || die "Unable to change to $tmpdir";
    142     &util::cp ($filename_full_path, $tmpdir);
     143    &FileUtils::copyFiles ($filename_full_path, $tmpdir);
    143144   
    144145    if ($file =~ /\.bz$/i) {
     
    173174    &metadatautil::combine_metadata_structures($this_metadata, $metadata);
    174175    my $numdocs = &plugin::read ($pluginfo, "", $tmpdir, $block_hash, $this_metadata, $processor, $maxdocs, $total_count, $gli);
    175     &util::rm_r ($tmpdir);
     176    &FileUtils::removeFilesRecursive ($tmpdir);
    176177   
    177178    $self->{'num_archives'} ++;
     
    187188    if (system ("bunzip \"$file\"")!=0)
    188189    {
    189     &util::rm ($file);
     190    &FileUtils::removeFiles ($file);
    190191    }
    191192}
     
    197198    if (system ("bunzip2 \"$file\"")!=0)
    198199    {
    199     &util::rm ($file);
     200    &FileUtils::removeFiles ($file);
    200201    }
    201202}
     
    206207
    207208    system ("unzip \"$file\"");
    208     &util::rm ($file) if -e $file;
     209    &FileUtils::removeFiles ($file) if -e $file;
    209210}
    210211
     
    214215
    215216    system ("tar xf \"$file\"");
    216     &util::rm ($file) if -e $file;
     217    &FileUtils::removeFiles ($file) if -e $file;
    217218}
    218219
     
    223224    if (system ("gunzip \"$file\"")!=0)
    224225    {
    225     &util::rm ($file);
     226    &FileUtils::removeFiles ($file);
    226227    };
    227228}
Note: See TracChangeset for help on using the changeset viewer.