Merge branch 'master' of github.com:heimdal/heimdal
[heimdal.git] / po / gen-po.in
blob78ef93dc0b1f98ae44ae8d47b68b50c283c7d626
1 #!/bin/sh
3 top_srcdir=@top_srcdir@
4 name="@PACKAGE_NAME@"
5 version="@PACKAGE_VERSION@"
7 domain=$1
8 shift
10 outdir=${top_srcdir}/po/${domain}
11 outfile=${outdir}/${domain}.pot
13 test -d $outdir || mkdir $outdir
15 xgettext \
16 --package-name="${name}" \
17 --package-version="${version}" \
18 --foreign-user \
19 --default-domain=${domain} \
20 --add-comments \
21 --keyword=N_ \
22 --keyword=NP_ \
23 -o ${outfile}.new \
24 "$@"
26 test -f ${outfile}.new && \
27 perl -pi -e "s@${top_srcdir}/@@" ${outfile}.new
29 grep -v "POT-Creation-Date:" ${outfile}.new > ${outfile}.new2
30 grep -v "POT-Creation-Date:" ${outfile} > ${outfile}.old
32 if ! diff ${outfile}.old ${outfile}.new2 >/dev/null; then
33 echo "${outfile} changed"
34 cp ${outfile}.new ${outfile}
36 rm ${outfile}.new* ${outfile}.old
38 exit 0