summaryrefslogtreecommitdiff
path: root/mk/tools
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-04-14 14:06:54 +0000
committerjlam <jlam@pkgsrc.org>2006-04-14 14:06:54 +0000
commit0be006d1fe47e6ba6cec2ab4b35d9daba7f44156 (patch)
tree5bec18bcbd4dafbabbbe986e70a0a23ee0164d20 /mk/tools
parente6b25b4debe282386704e9d2e9de617f10d3c2a7 (diff)
downloadpkgsrc-0be006d1fe47e6ba6cec2ab4b35d9daba7f44156.tar.gz
Now that I understand why we strip "#~" from the head of lines, strip
it consistently whenever we read a new line of input throughout the script. Note that this was actually broken in the original msgfmt.pl script as well.
Diffstat (limited to 'mk/tools')
-rwxr-xr-xmk/tools/msgfmt.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/mk/tools/msgfmt.sh b/mk/tools/msgfmt.sh
index 6271b05a54d..4ec4ab71230 100755
--- a/mk/tools/msgfmt.sh
+++ b/mk/tools/msgfmt.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: msgfmt.sh,v 1.5 2006/04/14 13:49:17 jlam Exp $
+# $NetBSD: msgfmt.sh,v 1.6 2006/04/14 14:06:54 jlam Exp $
#
# Copyright (c) 2006 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -113,9 +113,10 @@ ${CAT} $pofile | ${AWK} '
# Treat "obsolete" messages identically with non-"obsolete"
# ones so that we do not need to specially handle lines
- # starting with "#~".
+ # starting with "#~". We run this below whenever we read a
+ # new line of input.
#
- sub("^#~", "")
+ sub("^#~[ ]*", "")
# Buffer any "msgid" statements into the singular array.
if ($0 ~ /^msgid[ ]+/) {
@@ -123,6 +124,7 @@ ${CAT} $pofile | ${AWK} '
singular[s++] = $0
while (getline) {
if ($0 ~ /^$/) continue
+ sub("^#~[ ]*", "")
if ($0 ~ /^[ ]*"/)
singular[s++] = $0
else
@@ -135,6 +137,7 @@ ${CAT} $pofile | ${AWK} '
sub("^msgid_plural[ ]+", "");
plural[p++] = $0
while (getline) {
+ sub("^#~[ ]*", "")
if ($0 ~ /^[ ]*"/)
plural[p++] = $0
else
@@ -154,6 +157,7 @@ ${CAT} $pofile | ${AWK} '
}
print "msgstr " $0
while (getline) {
+ sub("^#~[ ]*", "")
if ($0 ~ /^[ ]*"/)
print $0
else
@@ -173,6 +177,7 @@ ${CAT} $pofile | ${AWK} '
}
print "msgstr " $0
while (getline) {
+ sub("^#~[ ]*", "")
if ($0 ~ /^[ ]*"/)
print $0
else
@@ -202,6 +207,7 @@ ${CAT} $pofile | ${AWK} '
}
if (equal == 1) {
while (getline) {
+ sub("^#~[ ]*", "")
if ($0 !~ /^[ ]*"/) break
}
s = 0; p = 0
@@ -215,6 +221,7 @@ ${CAT} $pofile | ${AWK} '
}
print "msgstr " $0
while (getline) {
+ sub("^#~[ ]*", "")
if ($0 ~ /^[ ]*"/)
print $0
else