Changeset 9570


Ignore:
Timestamp:
2005-04-07T11:54:37+12:00 (19 years ago)
Author:
davidb
Message:

Mods made as a result of testing importfrom.pl under Windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/importfrom.pl

    r9543 r9570  
    3232# Currently only designed for OAI exporting
    3333
    34 
    3534BEGIN {
    3635    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
     
    4443use FileHandle;
    4544
     45my $wgetopt = "";
    4646
    4747sub print_usage {
     
    8282    print $out "Requesting list of identifiers ...\n";
    8383
    84     open (OAIIN,"wget -q -O - \"$base_url?verb=ListIdentifiers&metadataPrefix=oai_dc\" |")
     84    open (OAIIN,"wget $wgetopt -q -O - \"$base_url?verb=ListIdentifiers&metadataPrefix=oai_dc\" |")
    8585    || die "wget request failed: $!\n";
    8686 
     
    144144    my $full_id_fname = &util::filename_cat($srcdocs_dir,$id_fname);
    145145
    146     my $wget_cmd = "wget -q -O $full_id_fname \"$doc_url\"";
     146    my $wget_cmd = "wget $wgetopt -q -O $full_id_fname \"$doc_url\"";
    147147
    148148    (system($wget_cmd)==0)
     
    165165    print $out "Downloading metadata record for $i\n";
    166166
    167     my $file_i_url = "$output_dir/$i.oai";
    168     $file_i_url =~ s/:/\//g;
     167        my $i_url = $i; #convert OAI set separators (:) to directory sep
     168        $i_url =~ s/:/\//g;
     169    my $file_i_url = "$output_dir/$i_url.oai";
    169170
    170171    my $ds = &util::get_dirsep();
    171     my $file_i = &util::filename_cat($output_dir,"$i.oai");
    172     $file_i =~ s/:/$ds/g;
     172    my $i_os = $i; #convert OAI set separators (:) to OS dir sep
     173    $i_os =~ s/:/$ds/g;
     174    my $file_i = &util::filename_cat($output_dir,"$i_os.oai");
    173175
    174176    # obtain record
    175     my $wget_cmd = "wget -q -O - \"$url\"";
     177    my $wget_cmd = "wget $wgetopt -q -O - \"$url\"";
    176178
    177179    open (OAIIN,"$wget_cmd|")
     
    189191    # prepare subdirectory for record (if needed)
    190192    my ($i_dir,$unused) = dir_file_split($file_i_url);
     193
    191194    &util::mk_all_dir($i_dir);
    192195
Note: See TracChangeset for help on using the changeset viewer.