Author: cazfi
Date: Mon Mar 16 05:18:33 2015
New Revision: 28559

URL: http://svn.gna.org/viewcvs/freeciv?rev=28559&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:
    branches/S2_6/bootstrap/Makefile.am
    branches/S2_6/bootstrap/generate_langstat.sh
    branches/S2_6/translations/stats.sh

Modified: branches/S2_6/bootstrap/Makefile.am
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/bootstrap/Makefile.am?rev=28559&r1=28558&r2=28559&view=diff
==============================================================================
--- branches/S2_6/bootstrap/Makefile.am (original)
+++ branches/S2_6/bootstrap/Makefile.am Mon Mar 16 05:18:33 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: branches/S2_6/bootstrap/generate_langstat.sh
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/bootstrap/generate_langstat.sh?rev=28559&r1=28558&r2=28559&view=diff
==============================================================================
--- branches/S2_6/bootstrap/generate_langstat.sh        (original)
+++ branches/S2_6/bootstrap/generate_langstat.sh        Mon Mar 16 05:18:33 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: branches/S2_6/translations/stats.sh
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/translations/stats.sh?rev=28559&r1=28558&r2=28559&view=diff
==============================================================================
--- branches/S2_6/translations/stats.sh (original)
+++ branches/S2_6/translations/stats.sh Mon Mar 16 05:18:33 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