Changeset 30624

Show
Ignore:
Timestamp:
26.07.2016 19:24:33 (3 years ago)
Author:
ak19
Message:

Using the new FileUtils? method for filename_cat and rm_r instead of the old versions.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/cgi-bin/gsdlCGI.pm

    r27318 r30624  
    513513    # assume the GS3 web folder is in the default location 
    514514    if(!defined $gsdl3home) {  
    515         $gsdl3home = &util::filename_cat($ENV{'GSDL3SRCHOME'}, "web"); 
     515        $gsdl3home = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'}, "web"); 
    516516        $self->{'gsdl3home'} = $gsdl3home; 
    517517    }  
     
    519519    } 
    520520     
    521     my $gsdl_bin_script = &util::filename_cat($gsdlhome,"bin","script"); 
     521    my $gsdl_bin_script = &FileUtils::filenameConcatenate($gsdlhome,"bin","script"); 
    522522    &util::envvar_prepend("PATH",$gsdl_bin_script); 
    523523     
    524     my $gsdl_bin_os = &util::filename_cat($gsdlhome,"bin",$gsdlos); 
     524    my $gsdl_bin_os = &FileUtils::filenameConcatenate($gsdlhome,"bin",$gsdlos); 
    525525    &util::envvar_prepend("PATH",$gsdl_bin_os); 
    526526     
    527527    # set up ImageMagick for the remote server in parallel to what setup.bash does 
    528     my $magick_home = &util::filename_cat($gsdl_bin_os,"imagemagick"); 
     528    my $magick_home = &FileUtils::filenameConcatenate($gsdl_bin_os,"imagemagick"); 
    529529    if(-e $magick_home) { 
    530530    &util::envvar_prepend("PATH", $magick_home); 
     
    534534    # no harm (that I can see) in keeping them in 
    535535 
    536     my $magick_bin = &util::filename_cat($magick_home,"bin"); 
    537     my $magick_lib = &util::filename_cat($magick_home,"lib"); 
     536    my $magick_bin = &FileUtils::filenameConcatenate($magick_home,"bin"); 
     537    my $magick_lib = &FileUtils::filenameConcatenate($magick_home,"lib"); 
    538538 
    539539    &util::envvar_prepend("PATH", $magick_bin); 
     
    552552 
    553553    # set up GhostScript for the remote server in parallel to what setup.bash does 
    554     my $ghostscript_home = &util::filename_cat($gsdl_bin_os,"ghostscript"); 
     554    my $ghostscript_home = &FileUtils::filenameConcatenate($gsdl_bin_os,"ghostscript"); 
    555555    if(-e $ghostscript_home) { 
    556     my $ghostscript_bin = &util::filename_cat($ghostscript_home,"bin"); 
     556    my $ghostscript_bin = &FileUtils::filenameConcatenate($ghostscript_home,"bin"); 
    557557    &util::envvar_prepend("PATH", $ghostscript_bin); 
    558558 
    559559    if(!defined $ENV{'GS_LIB'} || $ENV{'GS_LIB'} eq "") { 
    560         $ENV{'GS_LIB'} = &util::filename_cat($ghostscript_home,"share","ghostscript","8.63","lib");      
     560        $ENV{'GS_LIB'} = &FileUtils::filenameConcatenate($ghostscript_home,"share","ghostscript","8.63","lib");      
    561561    } 
    562562    if(!defined $ENV{'GS_FONTPATH'} || $ENV{'GS_FONTPATH'} eq "") { 
    563         $ENV{'GS_FONTPATH'} = &util::filename_cat($ghostscript_home,"share","ghostscript","8.63","Resource","Font"); 
     563        $ENV{'GS_FONTPATH'} = &FileUtils::filenameConcatenate($ghostscript_home,"share","ghostscript","8.63","Resource","Font"); 
    564564    } 
    565565    } 
     
    574574    #my ($perl_home) = ($perl_bin_dir =~ m/(.*)[\\|\/]bin[\\|\/]?$/); 
    575575    my ($tailname,$perl_home) = File::Basename::fileparse($perl_bin_dir, "\\.(?:[^\\.]+?)\$"); 
    576     $ENV{'PERL5LIB'} = &util::filename_cat($perl_home, "lib"); 
     576    $ENV{'PERL5LIB'} = &FileUtils::filenameConcatenate($perl_home, "lib"); 
    577577 
    578578    if($gsdlos eq "darwin") { 
    579         &util::envvar_prepend("DYLD_LIBRARY_PATH", &util::filename_cat($perl_home,"5.8.9","darwin-thread-multi-2level","CORE")); 
     579        &util::envvar_prepend("DYLD_LIBRARY_PATH", &FileUtils::filenameConcatenate($perl_home,"5.8.9","darwin-thread-multi-2level","CORE")); 
    580580    } elsif($gsdlos eq "linux") { 
    581         &util::envvar_prepend("LD_LIBRARY_PATH", &util::filename_cat($perl_home,"5.8.9","i686-linux-thread-multi","CORE")); 
     581        &util::envvar_prepend("LD_LIBRARY_PATH", &FileUtils::filenameConcatenate($perl_home,"5.8.9","i686-linux-thread-multi","CORE")); 
    582582    } 
    583583    } 
     
    587587    # is from SVN, the user must have their own Perl and put it on the PATH or set 
    588588    # perlpath in the gsdl site config file. 
    589     $perl_bin_dir = &util::filename_cat($gsdlhome, "bin", "windows", "perl", "bin"); 
     589    $perl_bin_dir = &FileUtils::filenameConcatenate($gsdlhome, "bin", "windows", "perl", "bin"); 
    590590    if(-e $perl_bin_dir) { 
    591591        &util::envvar_append("PATH", $perl_bin_dir); 
     
    606606    my @ext_homes = (); 
    607607 
    608     my $gsdl_ext_home = &util::filename_cat($gsdlhome,"ext"); 
     608    my $gsdl_ext_home = &FileUtils::filenameConcatenate($gsdlhome,"ext"); 
    609609    push(@ext_homes,$gsdl_ext_home); 
    610610 
    611611    if ($self->{'greenstone_version'} == 3) { 
    612612    my $gsdl3srchome = $self->get_gsdl3_src_home(); 
    613     my $gsdl3_ext_home = &util::filename_cat($gsdl3srchome,"ext"); 
     613    my $gsdl3_ext_home = &FileUtils::filenameConcatenate($gsdl3srchome,"ext"); 
    614614    push(@ext_homes,$gsdl3_ext_home); 
    615615    } 
     
    624624         
    625625        foreach my $ed (@pot_ext_dir) { 
    626         my $full_ext_dir = &util::filename_cat($ext_home,$ed); 
     626        my $full_ext_dir = &FileUtils::filenameConcatenate($ext_home,$ed); 
    627627 
    628628        if (-d $full_ext_dir) { 
    629629 
    630             my $full_ext_perllib_dir = &util::filename_cat($full_ext_dir,"perllib"); 
     630            my $full_ext_perllib_dir = &FileUtils::filenameConcatenate($full_ext_dir,"perllib"); 
    631631            if (-d $full_ext_perllib_dir) { 
    632632            unshift (@INC, $full_ext_perllib_dir); 
    633633            } 
    634634 
    635             my $full_inc_file = &util::filename_cat($full_ext_dir, 
     635            my $full_inc_file = &FileUtils::filenameConcatenate($full_ext_dir, 
    636636                                "$ed-setup.pl"); 
    637637            if (-f $full_inc_file) { 
     
    677677    if($self->{'greenstone_version'} == 2 && defined $ENV{'GSDLHOME'}) { 
    678678    if(defined $collection) { 
    679         $collection_directory = &util::filename_cat($ENV{'GSDLHOME'}, "collect", $collection); 
     679        $collection_directory = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "collect", $collection); 
    680680    } else { 
    681         $collection_directory = &util::filename_cat($ENV{'GSDLHOME'}, "collect"); 
     681        $collection_directory = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "collect"); 
    682682    } 
    683683    } 
     
    685685    if(defined $ENV{'GSDL3HOME'}) { 
    686686        if(defined $collection) { 
    687         $collection_directory = &util::filename_cat($ENV{'GSDL3HOME'}, "sites", $site, "collect", $collection); 
     687        $collection_directory = &FileUtils::filenameConcatenate($ENV{'GSDL3HOME'}, "sites", $site, "collect", $collection); 
    688688        } else { 
    689         $collection_directory = &util::filename_cat($ENV{'GSDL3HOME'}, "sites", $site, "collect"); 
     689        $collection_directory = &FileUtils::filenameConcatenate($ENV{'GSDL3HOME'}, "sites", $site, "collect"); 
    690690        } 
    691691    } 
    692692    elsif(defined $ENV{'GSDL3SRCHOME'}) { 
    693693        if(defined $collection) { 
    694         $collection_directory = &util::filename_cat($ENV{'GSDL3SRCHOME'}, "web", "sites", $site, "collect", $collection); 
     694        $collection_directory = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'}, "web", "sites", $site, "collect", $collection); 
    695695        } else { 
    696         $collection_directory = &util::filename_cat($ENV{'GSDL3SRCHOME'}, "web", "sites", $site, "collect"); 
     696        $collection_directory = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'}, "web", "sites", $site, "collect"); 
    697697        } 
    698698    } 
     
    707707 
    708708    my $prefix_dir = getcwd();  
    709     my $full_path = &util::filename_cat($prefix_dir,$local_dir); 
     709    my $full_path = &FileUtils::filenameConcatenate($prefix_dir,$local_dir); 
    710710     
    711711    if ($prefix_dir !~ m/collect/) { 
     
    718718    } 
    719719 
    720     &util::rm_r($full_path); 
     720    &FileUtils::removeFilesRecursive($full_path); 
    721721} 
    722722 
     
    728728    my $java_home = $ENV{'JAVA_HOME'}; 
    729729    $java_home =~ s/\/$//;  # Remove trailing slash if present (Unix specific) 
    730     return &util::filename_cat($java_home, "bin", "java"); 
     730    return &FileUtils::filenameConcatenate($java_home, "bin", "java"); 
    731731    } 
    732732 
     
    794794     
    795795    my $java = get_java_path(); 
    796     my $java_gsdl3_classpath = &util::filename_cat($gsdl3srchome, "web", "WEB-INF", "lib", "gsdl3.jar"); 
    797     my $java_remaining_classpath = &util::filename_cat($gsdl3srchome, "web", "WEB-INF", "lib", "*"); # log4j etc 
     796    my $java_gsdl3_classpath = &FileUtils::filenameConcatenate($gsdl3srchome, "web", "WEB-INF", "lib", "gsdl3.jar"); 
     797    my $java_remaining_classpath = &FileUtils::filenameConcatenate($gsdl3srchome, "web", "WEB-INF", "lib", "*"); # log4j etc 
    798798    my $java_classpath; 
    799799    my $gsdlos = $ENV{'GSDLOS'};