Changeset 29456 for main/trunk/greenstone2/bin
- Timestamp:
- 2014-11-20T19:01:20+13:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/gti.pl
r29415 r29456 1579 1579 # RESOURCE BUNDLE FUNCTIONS 1580 1580 1581 # need to handle multi-line properties. A multiline ends on \ if it continues over the next line 1581 1582 sub build_key_to_line_mapping_for_resource_bundle 1582 1583 { … … 1584 1585 1585 1586 my %chunk_key_to_line_mapping = (); 1587 1588 my $chunk_key; 1589 my $startindex = -1; 1590 1586 1591 for (my $i = 0; $i < scalar(@file_lines); $i++) { 1587 1592 my $line = $file_lines[$i]; … … 1590 1595 # Line contains a dictionary string 1591 1596 if ($line =~ /^(\S+?)[:|=](.*)$/) { 1592 my $chunk_key = $1; 1593 1597 $chunk_key = $1; 1598 $startindex = $i; 1599 } 1600 if ($startindex != -1) { 1601 if($line !~ m/\\$/) { # line finished 1602 # $i keeps track of the line at which this property (chunk_key) finishes 1603 1594 1604 # Map from chunk key to line 1595 $chunk_key_to_line_mapping{$chunk_key} = $i . "-" . $i; 1596 } 1605 $chunk_key_to_line_mapping{$chunk_key} = $startindex . "-" . $i; 1606 $startindex = -1; 1607 $chunk_key = ""; 1608 } 1609 } 1597 1610 } 1598 1611 … … 1606 1619 1607 1620 # Simple: just remove string key 1608 $chunk_text =~ s/^(\S+?)[:|=](\s*)// ;1609 $chunk_text =~ s/(\s*)$// ; # Remove any nasty whitespace, carriage returns etc.1610 $chunk_text =~ s/(\s*)\#\s+Updated\s+(\d?\d-\D\D\D-\d\d\d\d.*)\s*$//i ;1621 $chunk_text =~ s/^(\S+?)[:|=](\s*)//s; 1622 $chunk_text =~ s/(\s*)$//s; # Remove any nasty whitespace, carriage returns etc. 1623 $chunk_text =~ s/(\s*)\#\s+Updated\s+(\d?\d-\D\D\D-\d\d\d\d.*)\s*$//is; 1611 1624 1612 1625 return $chunk_text; … … 2049 2062 $target_files_key_to_gti_comment_mapping->{$global_chunk_key} = $target_file_key_to_gti_comment_mapping{$chunk_key}; 2050 2063 } 2051 } 2064 } 2052 2065 } 2053 2066 }
Note:
See TracChangeset
for help on using the changeset viewer.