Changeset 31515


Ignore:
Timestamp:
2017-03-14T19:30:00+13:00 (7 years ago)
Author:
ak19
Message:

Trying to bring near-identical functions servercontrol::get_library_url and util::get_full_greenstone_url_prefix() up to speed with each other before attempting to merge them in a hopefully upcoming commit

Location:
main/trunk/greenstone2/perllib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/servercontrol.pm

    r31514 r31515  
    459459   
    460460    #my $output = qx/ant get-default-servlet-url/; # backtick operator, to get STDOUT (else 2>&1)
    461     # see http://stackoverflow.com/questions/799968/whats-the-difference-between-perls-backticks-system-and-exec
     461    # - see http://stackoverflow.com/questions/799968/whats-the-difference-between-perls-backticks-system-and-exec
    462462   
    463463    # The get-default-servlet-url ant target can be run from anywhere by specifying the
     
    465465    # GSDL3SRCHOME will be set for GS3 by gs3-setup.sh, a step that would have been necessary
    466466    # to run the activate.pl script in the first place
    467     my $perl_command = "ant -buildfile \"$ENV{'GSDL3SRCHOME'}/build.xml\" get-default-servlet-url";
     467   
     468    my $full_build_xml = &FileUtils::javaFilenameConcatenate($ENV{'GSDL3SRCHOME'},"build.xml");
     469    my $perl_command = "ant -buildfile \"$full_build_xml\" get-default-servlet-url";
    468470   
    469471    if (open(PIN, "$perl_command |")) {
  • main/trunk/greenstone2/perllib/util.pm

    r31514 r31515  
    12441244        # Read in the entire contents of the file in one hit
    12451245        if (!open (FIN, $llssite_cfg)) {
    1246         print STDERR "util::get_library_URL() failed to open $llssite_cfg ($!)\n";
     1246        print STDERR "util::get_full_greenstone_url_prefix() failed to open $llssite_cfg ($!)\n";
    12471247        return undef;
    12481248        }
     
    12841284        #print STDERR "@@@@@ host: $host\n";
    12851285        if($url =~ m/https?:\/\/$host(\/)?$/) {
    1286             #if($url !~ m/http:\/\/$host:$portnumber(\/)?/ || $url =~ m/http:\/\/$host(\/)?$/) {
     1286            #if($url !~ m/https?:\/\/$host:$portnumber(\/)?/ || $url =~ m/https?:\/\/$host(\/)?$/) {
    12871287            # (if the URL does not contain the portnumber, OR if the port is implicitly 80 and)                 
    12881288            # If the domain with http:// prefix is completely the same as the URL, assume server.exe
     
    13291329        close(PIN);
    13301330    } else {
    1331         print STDERR "util::get_library_URL() failed to run $perl_command to work out library URL for $gs_mode\n";
     1331        print STDERR "util::get_full_greenstone_url_prefix() failed to run $perl_command to work out library URL for $gs_mode\n";
    13321332    }
    13331333    }
Note: See TracChangeset for help on using the changeset viewer.