Changeset 13332


Ignore:
Timestamp:
2006-11-24T14:16:19+13:00 (17 years ago)
Author:
kjdon
Message:

chdir doesn't seem to work on windows, so when using wget on windows, we add -Ppath to the command rather than changing directories. wget seems to get the link paths right on windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/LOMPlug.pm

    r13324 r13332  
    587587    }
    588588
    589     # if we pass an absolute path as -P arg to wget, then it stuffs up the
     589    # on linux, if we pass an absolute path as -P arg to wget, then it
     590    # stuffs up the
    590591    # URL rewriting in the file. Need a relative path or none, so now
    591592    # we change working directory first.
     593    my $changed_dir = 0;
    592594    my $current_dir = cwd();
    593     chdir "$output_dir";
    594     my $wget_cmd = "wget -nv  --timestamping -k -p \"$doc_url\"";
     595    my $wget_cmd = "";
     596    if ($ENV{'GSDLOS'} ne "windows") {
     597        $changed_dir = 1;
     598       
     599        chdir "$output_dir";
     600        $wget_cmd = "wget -nv  --timestamping -k -p \"$doc_url\"";
     601    } else {
     602        $wget_cmd = "wget -nv -P$output_dir --timestamping -k -p \"$doc_url\"";
     603    }
    595604    #my $wget_cmd = "wget -nv -P$output_dir --timestamping -k -p \"$doc_url\"";
    596605    ### my $full_dir_url = &File::Basename::dirname($full_file_url);
     
    602611   
    603612    $status = system($wget_cmd);
    604     chdir $current_dir;
    605 
     613    if ($changed_dir) {
     614        chdir $current_dir;
     615    }
    606616    if ($status==0) {
    607617        $self->{'lom_srcdoc'} = $full_file_url;
Note: See TracChangeset for help on using the changeset viewer.