[Debian-l10n-commits] r2700 - in /dl10n/trunk: Changelog compendia/createcompendium compendia/gen_compendia compendia/l10n.conf

nekral-guest at users.alioth.debian.org nekral-guest at users.alioth.debian.org
Sun Jul 24 23:06:06 UTC 2011


Author: nekral-guest
Date: Sun Jul 24 23:06:05 2011
New Revision: 2700

URL: http://svn.debian.org/wsvn/?sc=1&rev=2700
Log:
	* compendia/l10n.conf: Remove the creation of the POTMPDIR from
	the config file. Just define the parent directory TMPDIR.
	* compendia/gen_compendia: Enable set -e but do not fail with
	createcompendium, provide log instead.
	* compendia/createcompendium: The creation of the POTMPDIR is
	moved here, and is removed with trap.
	* compendia/createcompendium: Since set -e is enabled, we need to
	catch the msgcat failures (and we report them back to the log and
	the parent gen_compendia.

Modified:
    dl10n/trunk/Changelog
    dl10n/trunk/compendia/createcompendium
    dl10n/trunk/compendia/gen_compendia
    dl10n/trunk/compendia/l10n.conf

Modified: dl10n/trunk/Changelog
URL: http://svn.debian.org/wsvn/dl10n/trunk/Changelog?rev=2700&op=diff
==============================================================================
--- dl10n/trunk/Changelog (original)
+++ dl10n/trunk/Changelog Sun Jul 24 23:06:05 2011
@@ -1,3 +1,15 @@
+2011-07-25  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* compendia/l10n.conf: Remove the creation of the POTMPDIR from
+	the config file. Just define the parent directory TMPDIR.
+	* compendia/gen_compendia: Enable set -e but do not fail with
+	createcompendium, provide log instead.
+	* compendia/createcompendium: The creation of the POTMPDIR is
+	moved here, and is removed with trap.
+	* compendia/createcompendium: Since set -e is enabled, we need to
+	catch the msgcat failures (and we report them back to the log and
+	the parent gen_compendia.
+
 2011-02-20  Nicolas François  <nicolas.francois at centraliens.net>
 
 	* lib/Debian/L10n/BTS.pm: Added source package to a warning.

Modified: dl10n/trunk/compendia/createcompendium
URL: http://svn.debian.org/wsvn/dl10n/trunk/compendia/createcompendium?rev=2700&op=diff
==============================================================================
--- dl10n/trunk/compendia/createcompendium (original)
+++ dl10n/trunk/compendia/createcompendium Sun Jul 24 23:06:05 2011
@@ -8,6 +8,11 @@
 GENCOMPENDIUMPATH=${GENCOMPENDIUMPATH='.'}
 
 . "$GENCOMPENDIUMPATH"/l10n.conf
+
+#create a local tmp directory
+POTMPDIR=`mktemp -d "$TMPDIR"/cpd.XXXXXXXXXX`
+# cleanup local tmp directory on exit
+trap 'rm -rf "$POTMPDIR"' 0
 
 [ $# = 1 ] && MSGLANG=$1 || exit 1
 
@@ -20,22 +25,16 @@
 # for some odd reason convert_or_remove needs to be an external file
 # maybe because find doesn't have it defined in its environment
 find "$POTMPDIR" -name *.po -exec ./convert_or_remove {} \;
-msgcat -o "$RESULTS/compendium-$MSGLANG-stamp$STAMP.po" $POTMPDIR/*.po
+msgcat -o "$RESULTS/compendium-$MSGLANG-stamp$STAMP.po" $POTMPDIR/*.po || {
+	echo "EEE: failed to generate $RESULTS/compendium-$MSGLANG-stamp$STAMP.po"
+	exit 1
+}
 
-RESULT=$?
 
-# enable when code is stable
-rm -fr "$POTMPDIR"
+echo "III: generated $RESULTS/compendium-$MSGLANG-stamp$STAMP.po"
 
-if [ "$RESULT" = "0" ]
-then
-	echo "III: generated $RESULTS/compendium-$MSGLANG-stamp$STAMP.po"
-
-        # In order to be useful, the latest compendium needs to be used by users
-        ln -sf "$RESULTS/compendium-$MSGLANG-stamp$STAMP.po" "$RESULTS/compendium-$MSGLANG-LATEST.po"
-	# Remove old compendia and log files if we were successful
-	find "$RESULTS" -name "2*.log" -a -mtime "+1" -delete
-	find "$RESULTS" -name "compendium-*.po" -a -mtime "+1" -delete
-else
-	echo "EEE: failed to generate $RESULTS/compendium-$MSGLANG-stamp$STAMP.po"
-fi
+# In order to be useful, the latest compendium needs to be used by users
+ln -sf "$RESULTS/compendium-$MSGLANG-stamp$STAMP.po" "$RESULTS/compendium-$MSGLANG-LATEST.po"
+# Remove old compendia and log files if we were successful
+find "$RESULTS" -name "2*.log" -a -mtime "+1" -delete
+find "$RESULTS" -name "compendium-*.po" -a -mtime "+1" -delete

Modified: dl10n/trunk/compendia/gen_compendia
URL: http://svn.debian.org/wsvn/dl10n/trunk/compendia/gen_compendia?rev=2700&op=diff
==============================================================================
--- dl10n/trunk/compendia/gen_compendia (original)
+++ dl10n/trunk/compendia/gen_compendia Sun Jul 24 23:06:05 2011
@@ -1,6 +1,5 @@
 #!/bin/bash
-#set -x
-#set -e
+set -e
 
 export GENCOMPENDIUMPATH="/srv/dl10n-stuff/svn/dl10n/compendia"
 
@@ -9,7 +8,8 @@
 . "$GENCOMPENDIUMPATH"/l10n.conf
 
 for LL in $COMPENDIUM_LANGS ; do
-	"$GENCOMPENDIUMPATH"/createcompendium $LL
+	"$GENCOMPENDIUMPATH"/createcompendium $LL || {
+		# This should not happen
+		echo "createcompendium failed for language $LL"
+	}
 done
-
-[ -d $POTMPDIR ] && rm -rf $POTMPDIR || true

Modified: dl10n/trunk/compendia/l10n.conf
URL: http://svn.debian.org/wsvn/dl10n/trunk/compendia/l10n.conf?rev=2700&op=diff
==============================================================================
--- dl10n/trunk/compendia/l10n.conf (original)
+++ dl10n/trunk/compendia/l10n.conf Sun Jul 24 23:06:05 2011
@@ -7,8 +7,8 @@
 export PODEBCONFTGZ='/srv/i18n.debian.net/www/debian-l10n-material/po-debconf-unstable.tar.gz'
 export SITEDIR=/srv/i18n.debian.net/www/debian-l10n-material/po/unstable
 
-[ -d "/srv/i18n.debian.net/tmp/gen-compendia" ] || mkdir /srv/i18n.debian.net/tmp/gen-compendia
-[ -z "$NOTMPYET" ] && export POTMPDIR=`mktemp -d /srv/i18n.debian.net/tmp/gen-compendia/cpd.XXXXXXXXXX` && NOTMPYET=no || true
+export TMPDIR=/srv/i18n.debian.net/tmp/gen-compendia/
+[ -d "$TMPDIR" ] || mkdir "$TMPDIR"
 export RESULTS="/srv/i18n.debian.net/www/debian-l10n-compendia/po/"
 
 export STAMP=`date +%Y%m%d`




More information about the Debian-l10n-commits mailing list