1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
#! /bin/sh
# Copyright (C) 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check that the value of the 'Report-Msgid-Bugs-To' field in the POT file's
# header comes from the _MSGID_BUGS_ADDRESS variable if it is specified, or
# from the third argument of AC_INIT otherwise.
. ./defs || Exit 1
set -e
cat > Makefile.am << 'END'
locale_POTS = posub/foo-bar.pot
posub_foo_bar_pot_SOURCES = src/main.c
EXTRA_DIST = src/main.c
END
# Insert an email address as third argument of the AC_INIT invocation.
mv configure.in configure.in.bak
sed -e '/AC_INIT/{s/)$/, [info@yoyodyne.example.com])/}' < configure.in.bak > configure.in
cat >> configure.in << 'END'
AM_POT_TOOLS
AC_OUTPUT
END
mkdir src
cat > src/main.c << 'END'
#include <stdio.h>
int main ()
{
printf (gettext ("Hello, world.\n"));
return 0;
}
END
$ACLOCAL
$AUTOMAKE -a
$AUTOCONF
cat > expected << 'END'
# SOME DESCRIPTIVE TITLE.
# This file is put in the public domain.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pot-msgidbugs 1.0\n"
"Report-Msgid-Bugs-To: info@yoyodyne.example.com\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/main.c:4
#, c-format
msgid "Hello, world.\n"
msgstr ""
END
for builddir in . sub1; do
if test $builddir = '.'; then
sourcedir='.'
else
sourcedir='..'
mkdir $builddir
fi
instdir="`pwd`/instdir"
cd $builddir
$sourcedir/configure --prefix="$instdir"
$MAKE
# Check that "make distdir" creates the expected .pot file.
# (It is created under $sourcedir, because the .pot file is distributed.
# Cf. the GNU standards, node "Makefile Basics".)
$MAKE distdir
test -f $sourcedir/posub/foo-bar.pot
test $builddir = '.' || test ! -r posub/foo-bar.pot
cat $sourcedir/posub/foo-bar.pot | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > actual
diff actual $sourcedir/expected
rm -f actual
# Sanity check.
$MAKE distcheck
# Clean up.
$MAKE distclean
rm -rf "$instdir"
cd $sourcedir
done
cat >> Makefile.am << 'END'
posub_foo_bar_pot_MSGID_BUGS_ADDRESS = bug-maude@yoyodyne.example.com
END
cat > expected << 'END'
# SOME DESCRIPTIVE TITLE.
# This file is put in the public domain.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pot-msgidbugs 1.0\n"
"Report-Msgid-Bugs-To: bug-maude@yoyodyne.example.com\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/main.c:4
#, c-format
msgid "Hello, world.\n"
msgstr ""
END
$AUTOMAKE -a
for builddir in . sub2; do
if test $builddir = '.'; then
sourcedir='.'
else
sourcedir='..'
mkdir $builddir
fi
instdir="`pwd`/instdir"
cd $builddir
$sourcedir/configure --prefix="$instdir"
$MAKE
# Check that "make distdir" creates the expected .pot file.
# (It is created under $sourcedir, because the .pot file is distributed.
# Cf. the GNU standards, node "Makefile Basics".)
$MAKE distdir
test -f $sourcedir/posub/foo-bar.pot
test $builddir = '.' || test ! -r posub/foo-bar.pot
grep -v 'POT-Creation-Date' $sourcedir/posub/foo-bar.pot | LC_ALL=C tr -d '\r' > actual
diff actual $sourcedir/expected
rm -f actual
# Sanity check.
$MAKE distcheck
# Clean up.
$MAKE distclean
rm -rf "$instdir"
cd $sourcedir
done
:
|