Fix signal handling race condition.
[gnupg.git] / scripts / mail-to-translators
blob2894eea71ec04d3bbfe5841b2020b644582a2fd0
1 #!/bin/sh
2 # mail a compressed version of the current translation to the Last-Translator
5 # remove the colon to armor this script.
6 SENDMAIL=": /usr/sbin/sendmail"
8 for file in *.po; do
9 addr=$(head -100 $file | awk '/^# ?Designated-Translator:/ { printf "%s", $0; exit 0}' | sed 's/.*\(<.*>\).*/\1/')
10 if [ -z "$addr" ]; then
11 addr=$(awk '/Last-Translator:/ { printf "%s", $0; exit 0}' $file | sed 's/.*\(<.*>\).*/\1/')
13 ll=$(basename $file .po)
15 if ! msgfmt -vc $file 2>&1| egrep -q 'fuzzy|untranslated|error'; then
16 echo "$file: okay" >&2
17 continue;
18 fi
20 if ! echo "$addr" | grep -q @ ; then
21 echo "$file: no translator known" >&2
22 continue;
25 echo "$file: sending to $addr"
26 ( cat <<EOF
27 From: translations@gnupg.org
28 To: $addr
29 Mail-Followup-To: translations@gnupg.org
30 Subject: GnuPG 2.0 translation ($ll)
31 Date: $(date -R)
32 Mime-Version: 1.0
33 Content-Type: multipart/mixed; boundary="=-=-="
35 --=-=-=
37 Hi!
39 We are preparing for a new 2.0 release of GnuPG and like you to ask to
40 update your translation.
42 Please find attached the very latest version of the PO file for your
43 GnuPG translation ($file).
45 It is important to have a basic understanding of GnuPG's functionality
46 to do a correct translation. A false translation might lead to
47 security problems. Furthermore the TP Robot is not able to handle
48 more than one version of a project (we maintain 1.4 and 2.0) and thus
49 I'd ask you *not to use the TP Robot* for GnuPG.
51 The release candidate for 2.0.10 is available at:
53 ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/gnupg-2.0.10rc1.tar.bz2
54 ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/gnupg-2.0.10rc1.tar.bz2.sig
56 Output of msgfmt is:
57 $(msgfmt --check --statistics $file 2>&1 | head)
59 If you are not able to continue the translation work, I suggest to
60 pass this message on to another translator and drop a short note to
61 gnupg-hackers@gnupg.org .
64 Happy hacking,
66 Werner
69 --=-=-=
70 Content-Type: application/octet-stream
71 Content-Disposition: attachment; filename=gnupg-${file}.bz2
72 Content-Transfer-Encoding: base64
74 EOF
76 bzip2 <$file | mimencode
78 echo ""
79 echo "--=-=-=--"
80 echo ""
81 ) | $SENDMAIL -oi "$addr"
83 done