diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-02-01 19:00:37 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-02-01 19:00:37 +0000 |
commit | 2ae6009448cba9a8095a55915a192a5222bfd94c (patch) | |
tree | 35971996e208a68030306da4684f2dce66f316aa /tools | |
parent | 0457a578b52a2bb2f70eaddcfbaa67538203062d (diff) | |
download | rockbox-2ae6009448cba9a8095a55915a192a5222bfd94c.tar.gz rockbox-2ae6009448cba9a8095a55915a192a5222bfd94c.zip |
Keep comments other than the special ### comments.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5735 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/uplang | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/uplang b/tools/uplang index d290a79d37..5fb9563c22 100755 --- a/tools/uplang +++ b/tools/uplang | |||
@@ -37,13 +37,24 @@ while(<ENG>) { | |||
37 | close(ENG); | 37 | close(ENG); |
38 | 38 | ||
39 | undef %set; | 39 | undef %set; |
40 | my $cblock = 1; | ||
40 | open(NEW, "<$ARGV[1]"); | 41 | open(NEW, "<$ARGV[1]"); |
41 | while(<NEW>) { | 42 | while(<NEW>) { |
43 | $_ =~ s/\r//g; | ||
44 | |||
42 | if($_ =~ /^ *\#/) { | 45 | if($_ =~ /^ *\#/) { |
43 | # comment | 46 | # comment |
47 | if($_ !~ /^ *\#\#\#/) { | ||
48 | # no special ### comment -> keep it | ||
49 | if(!$cblock) { | ||
50 | print "\n"; | ||
51 | $cblock = 1; | ||
52 | } | ||
53 | print $_; | ||
54 | } | ||
44 | next; | 55 | next; |
45 | } | 56 | } |
46 | $_ =~ s/\r//g; | 57 | $cblock = 0; |
47 | 58 | ||
48 | if($_ =~ /^ *([a-z]+): *(.*)/) { | 59 | if($_ =~ /^ *([a-z]+): *(.*)/) { |
49 | ($var, $value) = ($1, $2); | 60 | ($var, $value) = ($1, $2); |
@@ -54,7 +65,7 @@ while(<NEW>) { | |||
54 | # the last one for a single phrase | 65 | # the last one for a single phrase |
55 | 66 | ||
56 | if(!$ids{$set{'id'}}) { | 67 | if(!$ids{$set{'id'}}) { |
57 | print "### ".$set{'id'}." was not found in the english file!\n"; | 68 | print "\n### ".$set{'id'}." was not found in the english file!\n"; |
58 | next; | 69 | next; |
59 | } | 70 | } |
60 | 71 | ||