Author: cazfi
Date: Mon Mar 16 05:18:24 2015
New Revision: 28558

URL: http://svn.gna.org/viewcvs/freeciv?rev=28558&view=rev
Log:
First generate langstat.txt as temporary file in builddir, and copy it over to 
srcdir
if there's not one, or existing one differs from the newly generated file. Also 
modified
stats.sh to avoid attempt to write temporary file inside srcdir. These fix 
'make distcheck'
problems reported by fullmoon run.

See bug #23382

Modified:
    trunk/bootstrap/Makefile.am
    trunk/bootstrap/generate_langstat.sh
    trunk/translations/stats.sh

Modified: trunk/bootstrap/Makefile.am
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/bootstrap/Makefile.am?rev=28558&r1=28557&r2=28558&view=diff
==============================================================================
--- trunk/bootstrap/Makefile.am (original)
+++ trunk/bootstrap/Makefile.am Mon Mar 16 05:18:24 2015
@@ -39,7 +39,7 @@
                langnames.txt
 
 langstat.txt:
-       "$(top_srcdir)/bootstrap/generate_langstat.sh" "$(top_srcdir)" 
"$(top_srcdir)"
+       "$(top_srcdir)/bootstrap/generate_langstat.sh" "$(top_srcdir)" 
"$(top_builddir)"
 
 .PHONY: langstat.txt
 

Modified: trunk/bootstrap/generate_langstat.sh
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/bootstrap/generate_langstat.sh?rev=28558&r1=28557&r2=28558&view=diff
==============================================================================
--- trunk/bootstrap/generate_langstat.sh        (original)
+++ trunk/bootstrap/generate_langstat.sh        Mon Mar 16 05:18:24 2015
@@ -1,12 +1,14 @@
 #!/bin/bash
 
-rm -f "$2/bootstrap/langstat.txt"
+"$1/translations/stats.sh" release | (
+    while read CODE PRCT ; do
+        NLANG=$(grep "^$CODE " "$1/bootstrap/langnames.txt" 2>/dev/null | sed 
"s/$CODE //")
+        echo "$CODE $PRCT $NLANG"
+    done ) > "$2/bootstrap/langstat.txt.tmp"
 
-(
-    cd "$1/translations"
-    ./stats.sh release | (
-        while read CODE PRCT ; do
-            NLANG=$(grep "^$CODE " ../bootstrap/langnames.txt 2>/dev/null | 
sed "s/$CODE //")
-            echo "$CODE $PRCT $NLANG"
-        done )
-) >> "$2/bootstrap/langstat.txt"
+if ! test -f "$1/bootstrap/langstat.txt" ||
+   ! cmp "$1/bootstrap/langstat.txt" "$2/bootstrap/langstat.txt.tmp" ; then
+    mv "$2/bootstrap/langstat.txt.tmp" "$1/bootstrap/langstat.txt"
+else
+    rm -f "$2/bootstrap/langstat.txt.tmp"
+fi

Modified: trunk/translations/stats.sh
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/translations/stats.sh?rev=28558&r1=28557&r2=28558&view=diff
==============================================================================
--- trunk/translations/stats.sh (original)
+++ trunk/translations/stats.sh Mon Mar 16 05:18:24 2015
@@ -25,7 +25,7 @@
 for POFILE in $@
 do
   if test "x$POFILE" != "x" ; then
-    CODE=$(echo "$POFILE" | sed 's/.po//')
+    CODE=$(echo "$POFILE" | sed -e 's/.po//' -e 's,.*/,,' -e 's,.*\\,,')
     FSTR="$(LANG=C msgfmt --stat "$POFILE" 2>&1)"
     if echo $FSTR | grep translated >/dev/null ; then
       TRANS=$(echo $FSTR | sed 's/ translated.*//')
@@ -66,7 +66,7 @@
     echo "$domain"
     echo "----------"
   fi
-  ( cd "$SRCDIR/$domain"
-    dir_stats *.po
-    rm messages.mo )
+
+  dir_stats "$SRCDIR/$domain/*.po"
+  rm messages.mo
 done


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to