| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
top_srcdir=@top_srcdir@ |
| 4 |
name="@PACKAGE_NAME@" |
| 5 |
version="@PACKAGE_VERSION@" |
| 6 |
|
| 7 |
domain=$1 |
| 8 |
shift |
| 9 |
|
| 10 |
outdir=${top_srcdir}/po/${domain} |
| 11 |
outfile=${outdir}/${domain}.pot |
| 12 |
|
| 13 |
test -d $outdir || mkdir $outdir |
| 14 |
|
| 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 |
"$@" |
| 25 |
|
| 26 |
test -f ${outfile}.new && \ |
| 27 |
perl -pi -e "s@${top_srcdir}/@@" ${outfile}.new |
| 28 |
|
| 29 |
grep -v "POT-Creation-Date:" ${outfile}.new > ${outfile}.new2 |
| 30 |
grep -v "POT-Creation-Date:" ${outfile} > ${outfile}.old |
| 31 |
|
| 32 |
if ! diff ${outfile}.old ${outfile}.new2 >/dev/null; then |
| 33 |
echo "${outfile} changed" |
| 34 |
cp ${outfile}.new ${outfile} |
| 35 |
fi |
| 36 |
rm ${outfile}.new* ${outfile}.old |
| 37 |
|
| 38 |
exit 0 |
| 39 |
|