Ignore:
Timestamp:
2006-03-13T15:48:44+13:00 (18 years ago)
Author:
mdewsnip
Message:

Now only tries to obtain documents locally if the values (formed by -document_prefix, -document_field and -document_suffix) contain path information.

File:
1 edited

Legend:

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

    r11342 r11348  
    341341    $wget_options .= " --timestamping";  # Only re-download files if they're newer
    342342    `wget $wget_options $document_file_full --output-document $local_document_file`;
     343
     344    # Check the document was obtained successfully
     345    if (!-e $local_document_file) {
     346        print STDERR "WARNING: Could not obtain document file $document_file_full\n";
     347    }
    343348    }
    344349    # Document specified is on the disk
     
    349354    $local_document_file = &util::filename_cat($documents_directory, $document_file_name);
    350355
    351     &util::cp($document_file_full, $documents_directory);
    352     }
    353 
    354     # Check the document was obtained successfully
     356    # Only bother trying to copy the file if it contained some path information
     357    if ($document_file_full ne $document_file_name) {
     358        &util::cp($document_file_full, $documents_directory);
     359
     360        # Check the document was obtained successfully
     361        if (!-e $local_document_file) {
     362        print STDERR "WARNING: Could not obtain document file $document_file_full\n";
     363        }
     364    }
     365    }
     366
     367    # If the document wasn't obtained successfully, create a .nul file for it
    355368    if (!-e $local_document_file) {
    356     print STDERR "WARNING: Could not obtain document file $document_file_full\n";
    357 
    358369    $document_file_name .= ".nul";
    359370    open(NULL_FILE, ">$local_document_file.nul");
Note: See TracChangeset for help on using the changeset viewer.