Port to git.
This commit is contained in:
parent
9e689681f5
commit
d4e87aff33
12
compile
12
compile
|
@ -17,20 +17,14 @@
|
||||||
|
|
||||||
source "`dirname $0`/variables"
|
source "`dirname $0`/variables"
|
||||||
|
|
||||||
if [ ! $MSGFMT ]; then
|
for BRANCH in $BRANCHES; do
|
||||||
echo -e $RED"This program needs the msgfmt utility."$ENDCOLOR
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for BRANCH in $TRUNK $BRANCHES; do
|
|
||||||
echo -e "Repository: $BLUE$BRANCH"$ENDCOLOR
|
echo -e "Repository: $BLUE$BRANCH"$ENDCOLOR
|
||||||
DIR="$PREFIX-$BRANCH"
|
|
||||||
if [ ! -e "$MDIR/$BRANCH" ]; then
|
if [ ! -e "$MDIR/$BRANCH" ]; then
|
||||||
mkdir -p "$MDIR/$BRANCH"
|
mkdir -p "$MDIR/$BRANCH"
|
||||||
fi
|
fi
|
||||||
for file in `ls $DIR`; do
|
for file in `ls $BRANCH`; do
|
||||||
echo "Compiling $file";
|
echo "Compiling $file";
|
||||||
$MSGFMT "$DIR/$file" -o "$MDIR/$BRANCH/`echo wesnoth-$file | sed "s/."$LCODE".po/.mo/" | sed "s/wesnoth-wesnoth/wesnoth/"`"
|
$MSGFMT "$BRANCH/$file" -o "$MDIR/$BRANCH/`echo wesnoth-$file | sed "s/."$LCODE".po/.mo/" | sed "s/wesnoth-wesnoth/wesnoth/"`"
|
||||||
done
|
done
|
||||||
rm "$MDIR/$BRANCH/wesnoth-manpages.mo" "$MDIR/$BRANCH/wesnoth-manual.mo"
|
rm "$MDIR/$BRANCH/wesnoth-manpages.mo" "$MDIR/$BRANCH/wesnoth-manual.mo"
|
||||||
done
|
done
|
||||||
|
|
31
pack
31
pack
|
@ -16,35 +16,19 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
source "`dirname $0`/variables"
|
source "`dirname $0`/variables"
|
||||||
|
|
||||||
if [ ! $DIFF ]; then
|
|
||||||
echo -e $RED"This program needs the diff utility."$ENDCOLOR
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! $TAR ]; then
|
|
||||||
echo -e $RED"This program needs the tar utility."$ENDCOLOR
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! $BZIP2 ]; then
|
|
||||||
echo -e $RED"This program needs the bzip2 utility."$ENDCOLOR
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
counter=0
|
counter=0
|
||||||
|
for BRANCH in $BRANCHES; do
|
||||||
for BRANCH in $TRUNK $BRANCHES; do
|
echo -e "Checking out files from $BLUE$BRANCH"$ENDCOLOR
|
||||||
echo -e "Branch: $BLUE$BRANCH"$ENDCOLOR
|
$GIT archive --remote $REPO --prefix=$BRANCH-temp/ --format=tar $BRANCH:po | tar x
|
||||||
DIR="$PREFIX-$BRANCH"
|
|
||||||
mkdir "$LCODE-temp"
|
mkdir "$LCODE-temp"
|
||||||
for file in `find $DIR -follow -name "*.$LCODE.po"`; do
|
counter=0
|
||||||
|
for file in `find $BRANCH -follow -name "*.$LCODE.po"`; do
|
||||||
bfile=`basename $file`
|
bfile=`basename $file`
|
||||||
echo -n "Processing catalog $bfile... ";
|
echo -n "Processing catalog $bfile... ";
|
||||||
d=`echo "$bfile" | sed "s/.$LCODE.po//"`
|
d=`echo "$bfile" | sed "s/.$LCODE.po//"`
|
||||||
dirdomain=`echo wesnoth-$d | sed "s/wesnoth-wesnoth/wesnoth/"`
|
dirdomain=`echo wesnoth-$d | sed "s/wesnoth-wesnoth/wesnoth/"`
|
||||||
if [ -f "$BRANCH/$dirdomain/$LCODE.po" ]; then
|
if [ -f "$BRANCH-temp/$dirdomain/$LCODE.po" ]; then
|
||||||
if ! $DIFF -q "$file" "$BRANCH/$dirdomain/$LCODE.po" > /dev/null ; then
|
if ! $DIFF -q "$file" "$BRANCH-temp/$dirdomain/$LCODE.po" > /dev/null ; then
|
||||||
mkdir "$LCODE-temp/$dirdomain"
|
mkdir "$LCODE-temp/$dirdomain"
|
||||||
cp "$file" "$LCODE-temp/$dirdomain/$LCODE.po"
|
cp "$file" "$LCODE-temp/$dirdomain/$LCODE.po"
|
||||||
echo -e $GREEN"OK"$ENDCOLOR
|
echo -e $GREEN"OK"$ENDCOLOR
|
||||||
|
@ -72,6 +56,7 @@ for BRANCH in $TRUNK $BRANCHES; do
|
||||||
$BZIP2 --best $LCODE-$BRANCH.tar
|
$BZIP2 --best $LCODE-$BRANCH.tar
|
||||||
echo "New archive created."
|
echo "New archive created."
|
||||||
fi
|
fi
|
||||||
|
rm -rf $BRANCH-temp
|
||||||
rmdir $LCODE-temp
|
rmdir $LCODE-temp
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
31
statistics
31
statistics
|
@ -18,24 +18,13 @@
|
||||||
|
|
||||||
source "`dirname $0`/variables"
|
source "`dirname $0`/variables"
|
||||||
|
|
||||||
LC_NUMERIC="en_US.UTF-8"
|
LC_ALL=C
|
||||||
ODD_CHARS='<27>'
|
ODD_CHARS='<27>'
|
||||||
CL=0 # counter for css style
|
CL=0 # counter for css style
|
||||||
STATUS="OK" # Total status of translations
|
STATUS="OK" # Total status of translations
|
||||||
|
|
||||||
if [ ! $MSGFMT ]; then
|
for BRANCH in $BRANCHES; do
|
||||||
echo -e $RED"This program needs the msgfmt utility."$ENDCOLOR
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! $ISUTF8 ]; then
|
|
||||||
echo -e $RED"This program needs the isutf8 utility."$ENDCOLOR
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for BRANCH in $TRUNK $BRANCHES; do
|
|
||||||
echo -e "Repository: $BLUE$BRANCH"$ENDCOLOR
|
echo -e "Repository: $BLUE$BRANCH"$ENDCOLOR
|
||||||
DIR="$PREFIX-$BRANCH"
|
|
||||||
STATSFILE="statistics-$BRANCH.html"
|
STATSFILE="statistics-$BRANCH.html"
|
||||||
ERRORS="translation-errors-$BRANCH"
|
ERRORS="translation-errors-$BRANCH"
|
||||||
nerror=0; nwarn=0; npo=0; nt=0; nu=0; nf=0
|
nerror=0; nwarn=0; npo=0; nt=0; nu=0; nf=0
|
||||||
|
@ -93,15 +82,15 @@ for BRANCH in $TRUNK $BRANCHES; do
|
||||||
<td class=\"title\">graph</td>
|
<td class=\"title\">graph</td>
|
||||||
</tr>" >> $STATSFILE
|
</tr>" >> $STATSFILE
|
||||||
|
|
||||||
for file in `ls "$DIR"`; do
|
for file in `ls "$BRANCH"`; do
|
||||||
filename=`echo $file | sed s/.po//`
|
filename=`echo $file | sed s/.po//`
|
||||||
npo=$(($npo + 1)); has_errors="no"; has_warnings="no";
|
npo=$(($npo + 1)); has_errors="no"; has_warnings="no";
|
||||||
|
|
||||||
# Extract the declared charset, may be we use this in future.
|
# Extract the declared charset, may be we use this in future.
|
||||||
charset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' "$DIR/$file"`
|
charset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' "$BRANCH/$file"`
|
||||||
|
|
||||||
echo -n "Checking $file for UTF-8 inconsistencies... "
|
echo -n "Checking $file for UTF-8 inconsistencies... "
|
||||||
if $ISUTF8 < "$DIR/$file" > /dev/null 2>&1; then
|
if $ISUTF8 < "$BRANCH/$file" > /dev/null 2>&1; then
|
||||||
if ! echo $charset | grep -qi "UTF-8"; then
|
if ! echo $charset | grep -qi "UTF-8"; then
|
||||||
has_errors="yes"
|
has_errors="yes"
|
||||||
echo -e $RED"FAILED; non UTF-8 charset declaration for UTF-8 content"$ENDCOLOR
|
echo -e $RED"FAILED; non UTF-8 charset declaration for UTF-8 content"$ENDCOLOR
|
||||||
|
@ -120,7 +109,7 @@ for BRANCH in $TRUNK $BRANCHES; do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "Checking $file for odd characters... "
|
echo -n "Checking $file for odd characters... "
|
||||||
if grep -nH $ODD_CHARS "$DIR/$file" >> $ERRORS; then
|
if grep -nH $ODD_CHARS "$BRANCH/$file" >> $ERRORS; then
|
||||||
has_warnings="yes"
|
has_warnings="yes"
|
||||||
echo -e $RED"FAILED; odd characters found"$ENDCOLOR
|
echo -e $RED"FAILED; odd characters found"$ENDCOLOR
|
||||||
echo "$file: one or more odd character from the '$ODD_CHARS' set found." >> $ERRORS
|
echo "$file: one or more odd character from the '$ODD_CHARS' set found." >> $ERRORS
|
||||||
|
@ -131,7 +120,7 @@ for BRANCH in $TRUNK $BRANCHES; do
|
||||||
# Makes sense only if the file passed the UTF-8 check.
|
# Makes sense only if the file passed the UTF-8 check.
|
||||||
if [ "$has_errors" = "no" ]; then
|
if [ "$has_errors" = "no" ]; then
|
||||||
echo -n "Checking $file with msgfmt... "
|
echo -n "Checking $file with msgfmt... "
|
||||||
if ! LC_MESSAGES=C $MSGFMT --check -o /dev/null "$DIR/$file" >> $ERRORS; then
|
if ! LC_MESSAGES=C $MSGFMT --check -o /dev/null "$BRANCH/$file" >> $ERRORS; then
|
||||||
has_errors="yes"
|
has_errors="yes"
|
||||||
echo -e $RED"FAILED"$ENDCOLOR
|
echo -e $RED"FAILED"$ENDCOLOR
|
||||||
else
|
else
|
||||||
|
@ -150,7 +139,7 @@ for BRANCH in $TRUNK $BRANCHES; do
|
||||||
STATUS="Error"
|
STATUS="Error"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
stat=`LC_MESSAGES=C $MSGFMT --statistics -o /dev/null "$DIR/$file" 2>&1`
|
stat=`LC_MESSAGES=C $MSGFMT --statistics -o /dev/null "$BRANCH/$file" 2>&1`
|
||||||
t=`echo "$stat" | sed -ne 's/\([0-9]\+\) translated .*/\1/p'`; t=${t:-0}
|
t=`echo "$stat" | sed -ne 's/\([0-9]\+\) translated .*/\1/p'`; t=${t:-0}
|
||||||
u=`echo "$stat" | sed -ne 's/.* \([0-9]\+\) untranslated .*/\1/p'`; u=${u:-0}
|
u=`echo "$stat" | sed -ne 's/.* \([0-9]\+\) untranslated .*/\1/p'`; u=${u:-0}
|
||||||
f=`echo "$stat" | sed -ne 's/.* \([0-9]\+\) fuzzy translation.*/\1/p'`; f=${f:-0}
|
f=`echo "$stat" | sed -ne 's/.* \([0-9]\+\) fuzzy translation.*/\1/p'`; f=${f:-0}
|
||||||
|
@ -182,7 +171,7 @@ for BRANCH in $TRUNK $BRANCHES; do
|
||||||
|
|
||||||
echo "<tr class=\"row-$CL\">" >> $STATSFILE
|
echo "<tr class=\"row-$CL\">" >> $STATSFILE
|
||||||
CL=$(( ($CL+1)%2 ))
|
CL=$(( ($CL+1)%2 ))
|
||||||
echo " <td align=\"left\"><strong><a href=\""$DIR/$filename.po"\">`basename $filename`</a></strong></td>
|
echo " <td align=\"left\"><strong><a href=\""$BRANCH/$filename.po"\">`basename $filename`</a></strong></td>
|
||||||
<td class=\"percentage-$CL\" align=\"center\">$st</td>
|
<td class=\"percentage-$CL\" align=\"center\">$st</td>
|
||||||
<td class=\"row-$CL\" align=\"right\">$t</td>" >> $STATSFILE
|
<td class=\"row-$CL\" align=\"right\">$t</td>" >> $STATSFILE
|
||||||
printf '%s%d%s%.2f%s\n' " <td class=\"percentage-" $CL "\" align=\"right\">" $rt "</td>" >> $STATSFILE
|
printf '%s%d%s%.2f%s\n' " <td class=\"percentage-" $CL "\" align=\"right\">" $rt "</td>" >> $STATSFILE
|
||||||
|
@ -199,7 +188,7 @@ for BRANCH in $TRUNK $BRANCHES; do
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$npo" -eq 0 ]; then
|
if [ "$npo" -eq 0 ]; then
|
||||||
echo -e $RED"No '${PO}.po' file under '$DIR'."$ENDCOLOR
|
echo -e $RED"No '${PO}.po' file under '$BRANCH'."$ENDCOLOR
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
65
update
65
update
|
@ -17,68 +17,16 @@
|
||||||
|
|
||||||
source "`dirname $0`/variables"
|
source "`dirname $0`/variables"
|
||||||
|
|
||||||
if [ ! $SVN ]; then
|
|
||||||
echo -e $RED"This program needs the svn utility."$ENDCOLOR
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! $MSGFMT ]; then
|
|
||||||
echo -e $RED"This program needs the msgfmt utility."$ENDCOLOR
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! $MSGMERGE ]; then
|
|
||||||
echo -e $RED"This program needs the msgmerge utility."$ENDCOLOR
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! $MSGINIT ]; then
|
|
||||||
echo -e $RED"This program needs the msginit utility."$ENDCOLOR
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "Language: $RED$LCODE"$ENDCOLOR
|
echo -e "Language: $RED$LCODE"$ENDCOLOR
|
||||||
echo ""
|
|
||||||
|
|
||||||
if [ ! -z $TRUNK ]; then
|
|
||||||
if [ -e $TRUNK/.svn ]; then
|
|
||||||
echo -e "Updating repository: "$BLUE"trunk"
|
|
||||||
cd $TRUNK
|
|
||||||
$SVN update
|
|
||||||
cd ..
|
|
||||||
else
|
|
||||||
echo -e "Checking out repository: "$BLUE"trunk"
|
|
||||||
$SVN checkout "$REPO/$TRUNK/po" $TRUNK
|
|
||||||
fi
|
|
||||||
echo -e $ENDCOLOR
|
|
||||||
if [ ! -e "$PREFIX-$TRUNK" ]; then
|
|
||||||
mkdir "$PREFIX-$TRUNK"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
for BRANCH in $BRANCHES; do
|
for BRANCH in $BRANCHES; do
|
||||||
if [ -e $BRANCH/.svn ]; then
|
echo -e "Checking out files from $BLUE$BRANCH"$ENDCOLOR
|
||||||
echo -e "Updating repository: $BLUE$BRANCH"
|
if [ ! -e "$BRANCH" ]; then
|
||||||
cd $BRANCH
|
mkdir "$BRANCH"
|
||||||
$SVN update
|
|
||||||
cd ..
|
|
||||||
else
|
|
||||||
echo -e "Checking out repository: $BLUE$BRANCH"
|
|
||||||
$SVN checkout "$REPO/branches/$BRANCH/po" $BRANCH
|
|
||||||
fi
|
fi
|
||||||
echo -e $ENDCOLOR
|
$GIT archive --remote $REPO --prefix="$BRANCH-temp/" --format=tar "$BRANCH:po" | tar x
|
||||||
if [ ! -e "$PREFIX-$BRANCH" ]; then
|
for dir in `ls "$BRANCH-temp/wesnoth"* -d`; do
|
||||||
mkdir "$PREFIX-$BRANCH"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
for BRANCH in $TRUNK $BRANCHES; do
|
|
||||||
SVNDIR=$BRANCH
|
|
||||||
DIR="$PREFIX-$BRANCH"
|
|
||||||
echo -e "Merging: $BLUE$BRANCH"$ENDCOLOR
|
|
||||||
for dir in `ls $SVNDIR/wesnoth* -d`; do
|
|
||||||
echo "Processing `basename $dir | sed s/wesnoth-//`.$LCODE.po"
|
echo "Processing `basename $dir | sed s/wesnoth-//`.$LCODE.po"
|
||||||
file="$DIR/`basename $dir | sed s/wesnoth-//`.$LCODE.po"
|
file="$BRANCH/`basename $dir | sed s/wesnoth-//`.$LCODE.po"
|
||||||
if [ -f $dir"/"$LCODE".po" ]; then
|
if [ -f $dir"/"$LCODE".po" ]; then
|
||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
echo -e $BLUE"Merging:"$ENDCOLOR
|
echo -e $BLUE"Merging:"$ENDCOLOR
|
||||||
|
@ -99,5 +47,6 @@ for BRANCH in $TRUNK $BRANCHES; do
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
done
|
done
|
||||||
|
rm -rf "$BRANCH-temp"
|
||||||
done
|
done
|
||||||
echo -e $GREEN"Finished."$ENDCOLOR
|
echo -e $GREEN"Finished."$ENDCOLOR
|
||||||
|
|
16
variables
16
variables
|
@ -16,19 +16,17 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Repositories
|
# Repositories
|
||||||
REPO="http://svn.gna.org/svn/wesnoth"
|
REPO="~/repositories/wesnoth" # preferably local clone but remote should work as well
|
||||||
BRANCHES="1.6" # one or multiple branches separated by space. Can be blank.
|
BRANCHES="master 1.10" # one or multiple branches separated by space.
|
||||||
TRUNK="" # "trunk" or ""
|
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
LCODE="lt" # Language code. Only 1 language is supported.
|
LCODE="lt" # Language code. Only 1 language is supported.
|
||||||
|
|
||||||
#Paths
|
# Paths
|
||||||
MDIR="mo"
|
MDIR="mo"
|
||||||
PREFIX="workspace"
|
|
||||||
|
|
||||||
#Binaries
|
# Binaries. Don't forget to install them before usign these scripts.
|
||||||
SVN=`which svn 2> /dev/null`
|
GIT=`which git 2> /dev/null`
|
||||||
MSGFMT=`which msgfmt 2> /dev/null`
|
MSGFMT=`which msgfmt 2> /dev/null`
|
||||||
MSGMERGE=`which msgmerge 2> /dev/null`
|
MSGMERGE=`which msgmerge 2> /dev/null`
|
||||||
MSGINIT=`which msginit 2> /dev/null`
|
MSGINIT=`which msginit 2> /dev/null`
|
||||||
|
@ -37,8 +35,8 @@ TAR=`which tar 2> /dev/null`
|
||||||
BZIP2=`which bzip2 2> /dev/null`
|
BZIP2=`which bzip2 2> /dev/null`
|
||||||
DIFF=`which diff 2> /dev/null`
|
DIFF=`which diff 2> /dev/null`
|
||||||
|
|
||||||
#Colors
|
# Colors
|
||||||
RED="\033[1;31m"
|
RED="\033[1;31m"
|
||||||
GREEN="\033[1;32m"
|
GREEN="\033[1;32m"
|
||||||
BLUE="\033[1;34m"
|
BLUE="\033[1;34m"
|
||||||
ENDCOLOR="\033[0m"
|
ENDCOLOR="\033[0m"
|
||||||
|
|
Loading…
Reference in New Issue