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 | |
| parent | 0457a578b52a2bb2f70eaddcfbaa67538203062d (diff) | |
| download | rockbox-2ae6009448cba9a8095a55915a192a5222bfd94c.zip rockbox-2ae6009448cba9a8095a55915a192a5222bfd94c.tar.gz rockbox-2ae6009448cba9a8095a55915a192a5222bfd94c.tar.bz2 rockbox-2ae6009448cba9a8095a55915a192a5222bfd94c.tar.xz | |
Keep comments other than the special ### comments.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5735 a1c6a512-1295-4272-9138-f99709370657
| -rwxr-xr-x | tools/uplang | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/uplang b/tools/uplang index d290a79..5fb9563 100755 --- a/tools/uplang +++ b/tools/uplang @@ -37,13 +37,24 @@ while(<ENG>) { close(ENG); undef %set; +my $cblock = 1; open(NEW, "<$ARGV[1]"); while(<NEW>) { + $_ =~ s/\r//g; + if($_ =~ /^ *\#/) { # comment + if($_ !~ /^ *\#\#\#/) { + # no special ### comment -> keep it + if(!$cblock) { + print "\n"; + $cblock = 1; + } + print $_; + } next; } - $_ =~ s/\r//g; + $cblock = 0; if($_ =~ /^ *([a-z]+): *(.*)/) { ($var, $value) = ($1, $2); @@ -54,7 +65,7 @@ while(<NEW>) { # the last one for a single phrase if(!$ids{$set{'id'}}) { - print "### ".$set{'id'}." was not found in the english file!\n"; + print "\n### ".$set{'id'}." was not found in the english file!\n"; next; } |