summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFrans Pop <elendil@planet.nl>2005-12-03 10:34:24 +0000
committerFrans Pop <elendil@planet.nl>2005-12-03 10:34:24 +0000
commita8c825ebca4a3ac27c962121eeb5ba75091c2c7f (patch)
treea66851da30f0e26e992e5ad0013ef1a1afd053fc /scripts
parent25a4665934e17e0afbb70fba2513c673dbd05d49 (diff)
downloadinstallation-guide-a8c825ebca4a3ac27c962121eeb5ba75091c2c7f.zip
Set proper POT-Creation-Date
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update_pot18
1 files changed, 11 insertions, 7 deletions
diff --git a/scripts/update_pot b/scripts/update_pot
index cc94a4009..c3b1b1095 100755
--- a/scripts/update_pot
+++ b/scripts/update_pot
@@ -29,22 +29,26 @@ RET=0
[ -d $SOURCE ] || exit 1
mkdir -p $PODIR/pot
-# 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
-
for XML in `find $SOURCEDIR -name "*.xml"` ; do
echo "Creating new POT file for $XML"
POT=$(basename $XML .xml).pot
- xml2pot $XML >$PODIR/pot/$POT
+ # Let's also set a proper POT-Creation-Date
+ xml2pot $XML | \
+ sed "s/^.*POT-Creation-Date:.*$/\"POT-Creation-Date: $(date -u "+%F %R%z")\\\n\"/" \
+ >$PODIR/pot/$POT.new
RC=$?
if [ $RC -ne 0 ] ; then
RET=$RC
echo "Error: error $RC while executing xml2pot"
fi
+
+ # Revert changes if the only thing changed is the POT-Creation-Date
+ if diff $PODIR/pot/$POT $PODIR/pot/$POT.new | grep "^>" | grep -qv "POT-Creation-Date: " ; then
+ mv $PODIR/pot/$POT.new $PODIR/pot/$POT
+ else
+ rm $PODIR/pot/$POT.new
+ fi
done
exit $RET