| 10 |
exit 0 |
exit 0 |
| 11 |
fi |
fi |
| 12 |
|
|
| 13 |
|
if [ -z "`which xml2pot 2>/dev/null`" ] ; then |
| 14 |
|
echo "ERR: xml2pot not found, please install the poxml package" |
| 15 |
|
exit 1 |
| 16 |
|
fi |
| 17 |
|
|
| 18 |
BUILDDIR="./build" |
BUILDDIR="./build" |
| 19 |
if [ -z "$PO_USEBUILD" ] ; then |
if [ -z "$PO_USEBUILD" ] ; then |
| 20 |
WORKDIR="./integrated" |
WORKDIR="./integrated" |
| 29 |
[ -d $SOURCE ] || exit 1 |
[ -d $SOURCE ] || exit 1 |
| 30 |
mkdir -p $PODIR/pot |
mkdir -p $PODIR/pot |
| 31 |
|
|
|
# This check is broken! |
|
|
if [ -n "$(find $PODIR/pot/ -name *.pot 2>/dev/null)" ] ; then |
|
|
echo "Deleting old POT files..." |
|
|
rm $PODIR/pot/*.pot |
|
|
fi |
|
|
|
|
| 32 |
for XML in `find $SOURCEDIR -name "*.xml"` ; do |
for XML in `find $SOURCEDIR -name "*.xml"` ; do |
| 33 |
echo "Creating new POT file for $XML" |
echo "Creating new POT file for $XML" |
| 34 |
POT=$(basename $XML .xml).pot |
POT=$(basename $XML .xml).pot |
| 35 |
|
|
| 36 |
xml2pot $XML >$PODIR/pot/$POT |
# Let's also set a proper POT-Creation-Date |
| 37 |
|
xml2pot $XML | \ |
| 38 |
|
sed "s/^.*POT-Creation-Date:.*$/\"POT-Creation-Date: $(date -u "+%F %R%z")\\\n\"/" \ |
| 39 |
|
>$PODIR/pot/$POT.new |
| 40 |
RC=$? |
RC=$? |
| 41 |
if [ $RC -ne 0 ] ; then |
if [ $RC -ne 0 ] ; then |
| 42 |
RET=$RC |
RET=$RC |
| 43 |
echo "Error: error $RC while executing xml2pot" |
echo "Error: error $RC while executing xml2pot" |
| 44 |
fi |
fi |
| 45 |
|
|
| 46 |
|
# Revert changes if the only thing changed is the POT-Creation-Date |
| 47 |
|
if diff $PODIR/pot/$POT $PODIR/pot/$POT.new | grep "^>" | grep -qv "POT-Creation-Date: " ; then |
| 48 |
|
mv $PODIR/pot/$POT.new $PODIR/pot/$POT |
| 49 |
|
else |
| 50 |
|
rm $PODIR/pot/$POT.new |
| 51 |
|
fi |
| 52 |
done |
done |
| 53 |
|
|
| 54 |
exit $RET |
exit $RET |