The branch, master has been updated
via c6be70e8a39ed988a4921b483905e6ddd8f0fc00 (commit)
from 6091d9b6569a2653ac387b6213b623c41fd4340c (commit)
- Log -----------------------------------------------------------------
commit c6be70e8a39ed988a4921b483905e6ddd8f0fc00
Author: Marc Delisle <marc(a)infomarc.info>
Date: Tue Apr 26 07:52:46 2011 -0400
Use a variable for the generated file
-----------------------------------------------------------------------
Summary of changes:
scripts/remove-incomplete-mo | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/scripts/remove-incomplete-mo b/scripts/remove-incomplete-mo
index dfddc37..83d14ea 100755
--- a/scripts/remove-incomplete-mo
+++ b/scripts/remove-incomplete-mo
@@ -10,17 +10,23 @@ set -e
#
THRESHOLD=50
+#
+# Generated output file
+#
+OUTPUTFILE=libraries/language_stats.inc.php
+
if [ ! -z "$1" ] ; then
THRESHOLD=$1
fi
-echo '<?php' > libraries/language_stats.inc.php
-echo '/* Automatically generated file, do not edit! */' >> libraries/language_stats.inc.php
-echo '/* Generated by scripts/remove-incomplete-mo */' >> libraries/language_stats.inc.php
-echo '' >> libraries/language_stats.inc.php
-echo '$GLOBALS["language_stats"] = array (' >> libraries/language_stats.inc.php
+echo '<?php' > $OUTPUTFILE
+echo '/* Automatically generated file, do not edit! */' >> $OUTPUTFILE
+echo '/* Generated by scripts/remove-incomplete-mo */' >> $OUTPUTFILE
+echo '' >> $OUTPUTFILE
+echo '$GLOBALS["language_stats"] = array (' >> $OUTPUTFILE
check() {
+ OUTPUTFILE=$2
lang=`echo $1 | sed 's@po/\(.*\)\.po@\1@'`
STATS=`LC_ALL=C msgfmt --statistics -o /dev/null $1 2>&1`
if echo $STATS | grep -q ' translated ' ; then
@@ -39,7 +45,7 @@ check() {
UNTRANSLATED=0
fi
PERCENT=`expr 100 \* $TRANSLATED / \( $TRANSLATED + $FUZZY + $UNTRANSLATED \) || true`
- echo " '$lang' => $PERCENT," >> libraries/language_stats.inc.php
+ echo " '$lang' => $PERCENT," >> $OUTPUTFILE
if [ $PERCENT -lt $THRESHOLD ] ; then
echo "Removing $lang, only $PERCENT%"
@@ -48,8 +54,8 @@ check() {
}
for x in po/*.po ; do
- check $x
+ check $x $OUTPUTFILE
done
-echo ');' >> libraries/language_stats.inc.php
-echo '?>' >> libraries/language_stats.inc.php
+echo ');' >> $OUTPUTFILE
+echo '?>' >> $OUTPUTFILE
hooks/post-receive
--
phpMyAdmin