Changeset 17530 for gsdl/trunk/perllib


Ignore:
Timestamp:
2008-10-14T17:25:27+13:00 (16 years ago)
Author:
ak19
Message:

Fixed not being able to run wget from the cmd-line via downloadfrom.pl on Linux (since the cache-dir was empty, the -P flag took the url to download from to be the directory-prefix and this made wget assume that the url itself was missing). Tested that wget process is killed upon Ctrl-C being pressed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/downloaders/WebDownload.pm

    r17247 r17530  
    105105     
    106106    # Setup the command for using wget
    107      my $cache_dir = "";
    108     if ($ENV{'GSDLOS'} eq "windows") {   
    109     $cache_dir = "-P \"".$hashGeneralOptions->{"cache_dir"}."\" ";
    110     }
    111     else{
    112         $cache_dir = "-P ".$hashGeneralOptions->{"cache_dir"};
    113     }
    114 
     107    my $cache_dir = "";
     108    if($hashGeneralOptions->{'cache_dir'}) { # don't provide the prefix-dir flag to wget unless the cache_dir is specified
     109    if ($ENV{'GSDLOS'} eq "windows") {   
     110        $cache_dir = "-P \"".$hashGeneralOptions->{'cache_dir'}."\" ";
     111    }
     112    else {
     113        $cache_dir = "-P ".$hashGeneralOptions->{'cache_dir'};
     114    }
     115    }
    115116    #my $cmdWget = "-N -k -x -t 2 -P \"".$hashGeneralOptions->{"cache_dir"}."\" $strWgetOptions $strOptions ".$self->{'url'};
    116117    my $cmdWget = "-N -k -x -t 2  $strWgetOptions $strOptions $cache_dir " .$self->{'url'};   
    117    
     118
    118119    # Download the web pages
    119     # print "Strat download from $self->{'url'}...\n";
     120    # print "Start download from $self->{'url'}...\n";
    120121    print STDERR "<<Undefined Maximum>>\n";
    121122   
Note: See TracChangeset for help on using the changeset viewer.