Changeset 11487 for trunk/gsdl


Ignore:
Timestamp:
2006-03-27T13:57:22+12:00 (18 years ago)
Author:
mdewsnip
Message:

Added <Updated date="..."> comments to the greenstone XML files, to support updating.

File:
1 edited

Legend:

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

    r11452 r11487  
    12091209        my $chunk_key = $1;
    12101210        $line =~ s/\s*$//;  # Remove any nasty whitespace
     1211        $line =~ s/<Updated date=\"\d?\d-\D\D\D-\d\d\d\d\"\/>$//;
    12111212
    12121213        # While there is still text of the string to go...
     
    12361237    # Simple: just remove the Text tags
    12371238    $chunk_text =~ s/^\s*<Text id=\"(.*?)\">(\s*)//;
     1239    $chunk_text =~ s/<Updated date=\"\d?\d-\D\D\D-\d\d\d\d\"\/>$//;
    12381240    $chunk_text =~ s/<\/Text>$//;
    12391241
     
    12471249
    12481250    # Check for an "Updated DD-MMM-YYYY" comment at the end of the chunk
    1249     # !! TO DO
     1251    if ($chunk_text =~ /<Updated date=\"(\d?\d-\D\D\D-\d\d\d\d)\"\/>$/i) {
     1252    return $1;
     1253    }
    12501254
    12511255    return undef;
     
    13091313    print TARGET_FILE "<Text id=\"$chunk_key\">$target_file_chunk_text</Text>";
    13101314    if ($target_file_key_to_comment_date_mapping->{$chunk_key}) {
    1311         # print TARGET_FILE "  # Updated " . $target_file_key_to_comment_date_mapping->{$chunk_key};
     1315        print TARGET_FILE "<Updated date=\"" . $target_file_key_to_comment_date_mapping->{$chunk_key} . "\"\/>";
    13121316    }
    13131317    print TARGET_FILE "\n";
Note: See TracChangeset for help on using the changeset viewer.