Show
Ignore:
Timestamp:
11.08.2017 18:22:36 (2 years ago)
Author:
ak19
Message:

1. Previous commit message was incorrect: it wasn't that perl wasn't found that resulted in the open3() failure error message, but that something on the PATH wasn't available to it, possible wget itself. 2. Updating unused DownloadJob?.old_callDownload() to have the recently committed changes in callDownload(). 3. Emacs tabbing for recently committed files.

Location:
main/trunk/greenstone2/perllib/downloaders
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/downloaders/WebDownload.pm

    r31877 r31878  
    193193    my $strBaseCMD = $strOptions." --tries=2 -q -O - \"$self->{'url'}\""; 
    194194 
    195     #&util::print_env(STDERR, "https_proxy", "http_proxy", "HTTPS_PROXY", "HTTP_PROXY", "ftp_proxy", "FTP_PROXY"); 
    196     #&util::print_env(STDERR);   
    197      
     195    #&util::print_env(STDERR, "https_proxy", "http_proxy", "HTTPS_PROXY", "HTTP_PROXY", "ftp_proxy", "FTP_PROXY"); 
     196    #&util::print_env(STDERR);   
     197     
    198198    my $strIdentifyText = $self->useWget($strBaseCMD); 
    199199     
  • main/trunk/greenstone2/perllib/downloaders/WgetDownload.pm

    r31877 r31878  
    169169sub addProxySettingsAsWgetFlags 
    170170{ 
    171     my ($self) = @_; 
    172     my $strOptions = ""; 
    173      
    174     if ($self->{'proxy_on'} && $self->{'proxy_host'} && $self->{'proxy_port'}) 
    175     { 
    176         $strOptions .= " -e https_proxy=$self->{'proxy_host'}:$self->{'proxy_port'} ";   
    177         $strOptions .= " -e http_proxy=$self->{'proxy_host'}:$self->{'proxy_port'} ";        
    178          
    179         if ($self->{'user_name'} && $self->{'user_password'}) 
    180         { 
    181         $strOptions .= "--proxy-user=$self->{'user_name'}"." --proxy-passwd=$self->{'user_password'}"; 
    182         } 
    183     } 
    184  
    185     if ($self->{'proxy_on'}) { 
    186         $strOptions .= " --proxy "; 
    187     } 
    188      
    189     return $strOptions; 
    190 } 
    191  
    192 sub getWgetOptions 
    193 { 
    194171    my ($self) = @_; 
    195172    my $strOptions = ""; 
    196173     
    197     # If proxy settings are set up in the environment, wget is ready to use them. More secure. 
    198     # But if proxy settings are not set up in the environment, pass them as flags to wget 
    199     # This is less secure, as pwd etc visible in task manager, but it was the original way in 
    200     # which wget was run on windows. 
    201     # Truth in Perl: https://home.ubalt.edu/abento/452/perl/perltruth.html 
     174    if ($self->{'proxy_on'} && $self->{'proxy_host'} && $self->{'proxy_port'}) 
     175    { 
     176    $strOptions .= " -e https_proxy=$self->{'proxy_host'}:$self->{'proxy_port'} ";   
     177    $strOptions .= " -e http_proxy=$self->{'proxy_host'}:$self->{'proxy_port'} ";        
     178     
     179    if ($self->{'user_name'} && $self->{'user_password'}) 
     180    { 
     181        $strOptions .= "--proxy-user=$self->{'user_name'}"." --proxy-passwd=$self->{'user_password'}"; 
     182    } 
     183    } 
     184     
     185    if ($self->{'proxy_on'}) { 
     186    $strOptions .= " --proxy "; 
     187    } 
     188     
     189    return $strOptions; 
     190} 
     191 
     192sub getWgetOptions 
     193{ 
     194    my ($self) = @_; 
     195    my $strOptions = ""; 
     196     
     197    # If proxy settings are set up in the environment, wget is ready to use them. More secure. 
     198    # But if proxy settings are not set up in the environment, pass them as flags to wget 
     199    # This is less secure, as pwd etc visible in task manager, but it was the original way in 
     200    # which wget was run on windows. 
     201    # Truth in Perl: https://home.ubalt.edu/abento/452/perl/perltruth.html 
    202202    # http://www.perlmonks.org/?node=what%20is%20true%20and%20false%20in%20Perl%3F 
    203  
     203     
    204204    if (!$ENV{'http_proxy'} && !$ENV{'https_proxy'}) { 
    205         $strOptions .= $self->addProxySettingsAsWgetFlags(); 
     205    $strOptions .= $self->addProxySettingsAsWgetFlags(); 
    206206    } # else wget will use proxy settings in environment, assume enough settings have been provided 
     207     
     208    if($self->{'no_check_certificate'}) { # URL may be http that gets redirected to https, so if no_check_certificate is on, turn it on even if URL is http 
    207209     
    208     if($self->{'no_check_certificate'}) { # URL may be http that gets redirected to https, so if no_check_certificate is on, turn it on even if URL is http 
    209  
    210210    $strOptions .= " --no-check-certificate "; 
    211211    } 
    212      
     212     
    213213    return $strOptions; 
    214214} 
     
    288288    # closing an extra unused handle, a single handle is used instead for both the child's 
    289289    # stderr and stdout. 
    290     # See http://blog.0x1fff.com/2009/09/howto-execute-system-commands-in-perl.html 
    291     # for why this is the right thing to do. 
     290    # See http://blog.0x1fff.com/2009/09/howto-execute-system-commands-in-perl.html 
     291    # for why this is the right thing to do. 
    292292 
    293293    # Both open2 and open3 don't return on failure, but raise an exception. The handling