webperimental: killstack decides stack protects.
[freeciv.git] / bootstrap / generate_langstat.sh
blobd3b964f7ee418dde11a0999583339b063b3cd3f1
1 #!/bin/bash
2 #/**********************************************************************
3 # Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 #***********************************************************************/
16 if test "x$1" = "x-h" || test "x$1" = "x--help" || test "x$1" = "x" ; then
17 echo "Usage: $(basename $0) <translation domain> <freeciv source root> <freeciv build root>"
18 exit
21 "$2/translations/stats.sh" $1 | (
22 while read CODE PRCT ; do
23 NLANG=$(grep "^$CODE " "$2/bootstrap/langnames.txt" 2>/dev/null | sed "s/$CODE //")
24 echo "$CODE $PRCT $NLANG"
25 done ) > "$3/bootstrap/langstat_${1}.txt.tmp"
27 if ! test -f "$2/bootstrap/langstat_${1}.txt" ||
28 ! cmp "$2/bootstrap/langstat_${1}.txt" "$3/bootstrap/langstat_${1}.txt.tmp" ; then
29 mv "$3/bootstrap/langstat_${1}.txt.tmp" "$2/bootstrap/langstat_${1}.txt"
30 else
31 rm -f "$3/bootstrap/langstat_${1}.txt.tmp"