Replace tput sgr0 with

This commit is contained in:
Andrius Štikonas 2008-11-11 11:57:24 +02:00
parent 355cccf27a
commit 6e417dc835
4 changed files with 41 additions and 41 deletions

View File

@ -18,12 +18,12 @@
source variables
if [ ! $MSGFMT ]; then
echo -e $RED"This program needs the msgfmt utility."; tput sgr0
echo -e $RED"This program needs the msgfmt utility."$ENDCOLOR
exit 1
fi
for BRANCH in $TRUNK $BRANCHES; do
echo -e "Repository: $BLUE$BRANCH"; tput sgr0
echo -e "Repository: $BLUE$BRANCH"$ENDCOLOR
DIR="$PREFIX-$BRANCH"
if [ ! -e "$MDIR/$BRANCH" ]; then
mkdir -p "$MDIR/$BRANCH"
@ -34,4 +34,4 @@ for BRANCH in $TRUNK $BRANCHES; do
done
done
echo -ne $GREEN"Finished."; tput sgr0; echo " "
echo -e $GREEN"Finished."$ENDCOLOR

16
pack.sh
View File

@ -18,24 +18,24 @@
source variables
if [ ! $DIFF ]; then
echo -e $RED"This program needs the diff utility."; tput sgr0
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."; tput sgr0
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."; tput sgr0
echo -e $RED"This program needs the bzip2 utility."$ENDCOLOR
exit 1
fi
counter=0
for BRANCH in $TRUNK $BRANCHES; do
echo -e "Branch: $BLUE$BRANCH"; tput sgr0
echo -e "Branch: $BLUE$BRANCH"$ENDCOLOR
DIR="$PREFIX-$BRANCH"
mkdir "$LCODE-temp"
for file in `ls $DIR/wesnoth*.$LCODE.po`; do
@ -46,15 +46,15 @@ for BRANCH in $TRUNK $BRANCHES; do
if ! $DIFF -q "$file" "$BRANCH/$d/$LCODE.po" > /dev/null ; then
mkdir "$LCODE-temp/$d"
cp "$file" "$LCODE-temp/$d/$LCODE.po"
echo -e $GREEN"OK"; tput sgr0
echo -e $GREEN"OK"$ENDCOLOR
counter=$(($counter+1))
else
echo -e $BLUE"Skipping"; tput sgr0
echo -e $BLUE"Skipping"$ENDCOLOR
fi
else
mkdir -p "$LCODE-temp/$d"
cp "$file" "$LCODE-temp/$d/$LCODE.po"
echo -e $GREEN"OK"; tput sgr0
echo -e $GREEN"OK"$ENDCOLOR
counter=$(($counter+1))
fi
done
@ -73,4 +73,4 @@ for BRANCH in $TRUNK $BRANCHES; do
fi
done
echo -ne $GREEN"Finished."; tput sgr0; echo " "
echo -e $GREEN"Finished."$ENDCOLOR

View File

@ -24,17 +24,17 @@ CL=0 # counter for css style
STATUS="OK" # Total status of translations
if [ ! $MSGFMT ]; then
echo -e $RED"This program needs the msgfmt utility."; tput sgr0
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."; tput sgr0
echo -e $RED"This program needs the isutf8 utility."$ENDCOLOR
exit 1
fi
for BRANCH in $TRUNK $BRANCHES; do
echo -e "Repository: $BLUE$BRANCH"; tput sgr0
echo -e "Repository: $BLUE$BRANCH"$ENDCOLOR
DIR="$PREFIX-$BRANCH"
STATSFILE="statistics-$BRANCH.xhtml"
ERRORS="translation-errors-$BRANCH"
@ -475,28 +475,28 @@ html>body #footer {
if $ISUTF8 <$file >/dev/null 2>&1; then
if ! echo $charset | grep -qi "UTF-8"; then
has_errors="yes"
echo -e $RED"FAILED; non UTF-8 charset declaration for UTF-8 content"; tput sgr0
echo -e $RED"FAILED; non UTF-8 charset declaration for UTF-8 content"$ENDCOLOR
echo "$file: non UTF-8 charset declared for UTF-8 content; expect to see 'charset=UTF-8'." >> $ERRORS
else
echo -e $GREEN"OK"; tput sgr0
echo -e $GREEN"OK"$ENDCOLOR
fi
else
if echo $charset | grep -qi "UTF-8"; then
has_errors="yes"
echo -e $RED"FAILED; non UTF-8 content for UTF-8 charset declaration"; tput sgr0
echo -e $RED"FAILED; non UTF-8 content for UTF-8 charset declaration"$ENDCOLOR
echo "$file: UTF-8 charset declared for non UTF-8 content; expect to see a non UTF-8 charset." >> $ERRORS
else
echo -e $GREEN"OK"; tput sgr0
echo -e $GREEN"OK"$ENDCOLOR
fi
fi
echo -n "Checking $file for odd characters... "
if grep -nH $ODD_CHARS $file >> $ERRORS; then
has_warnings="yes"
echo -e $RED"FAILED; odd characters found"; tput sgr0
echo -e $RED"FAILED; odd characters found"$ENDCOLOR
echo "$file: one or more odd character from the '$ODD_CHARS' set found." >> $ERRORS
else
echo -e $GREEN"OK"; tput sgr0
echo -e $GREEN"OK"$ENDCOLOR
fi
# Makes sense only if the file passed the UTF-8 check.
@ -504,9 +504,9 @@ html>body #footer {
echo -n "Checking $file with msgfmt... "
if ! LC_MESSAGES=C $MSGFMT --check -o /dev/null $file >> $ERRORS; then
has_errors="yes"
echo -e $RED"FAILED"; tput sgr0
echo -e $RED"FAILED"$ENDCOLOR
else
echo -e $GREEN"OK"; tput sgr0
echo -e $GREEN"OK"$ENDCOLOR
fi
fi
r=0; rf=0; ru=0; t=0; u=0; f=0; rt=0
@ -570,23 +570,23 @@ html>body #footer {
done
if [ "$npo" -eq 0 ]; then
echo -e $RED"No '${PO}.po' file under '$DIR'."; tput sgr0
echo -e $RED"No '${PO}.po' file under '$DIR'."$ENDCOLOR
exit 0
fi
if [ "$nerror" -gt 0 ]; then
echo -n -e $RED"Fatal errors found. See '"
tput smso; echo -n "$ERRORS"; tput rmso
echo -ne "' for details."; tput sgr0
echo -ne "' for details."$ENDCOLOR
echo ""
else
echo -ne $GREEN"No fatal errors found."; tput sgr0
echo -ne $GREEN"No fatal errors found."$ENDCOLOR
echo ""
if [ -s "$ERRORS" ]; then
echo -n -e $RED" See '"
tput smso; echo -n "$ERRORS"; tput rmso
echo -ne "' for warnings."; tput sgr0
echo -ne "' for warnings."$ENDCOLOR
echo ""
else
rm -f $ERRORS
@ -594,7 +594,7 @@ html>body #footer {
fi
if [ "$npo" = "$nerror" ]; then
echo -en $RED"All files have fatal errors."; tput sgr0
echo -en $RED"All files have fatal errors."$ENDCOLOR
echo ""
else
sum=$((${nt} + ${nf} + ${nu}))

View File

@ -18,27 +18,27 @@
source variables
if [ ! $SVN ]; then
echo -e $RED"This program needs the svn utility."; tput sgr0
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."; tput sgr0
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."; tput sgr0
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."; tput sgr0
echo -e $RED"This program needs the msginit utility."$ENDCOLOR
exit 1
fi
if [ $GIT -eq 1 ] && [ ! $GITSVN ]; then
echo -e $RED"git-svn is unavailable. svn will be used."; tput sgr0
echo -e $RED"git-svn is unavailable. svn will be used."$ENDCOLOR
GIT=0
fi
@ -46,7 +46,7 @@ if [ $GIT -eq 1 ] && [ $GITSVN ]; then
SVN="$GITSVN clone"
fi
echo -e "Language: $RED$LCODE"; tput sgr0
echo -e "Language: $RED$LCODE"$ENDCOLOR
echo ""
if [ ! -z $TRUNK ]; then
@ -102,7 +102,7 @@ done
for BRANCH in $TRUNK $BRANCHES; do
SVNDIR=$BRANCH
DIR="$PREFIX-$BRANCH"
echo -e "Merging: $BLUE$BRANCH"; tput sgr0
echo -e "Merging: $BLUE$BRANCH"$ENDCOLOR
for dir in `ls $SVNDIR/wesnoth* -d`; do
echo "Processing "`basename $dir`"."$LCODE".po"
stat=`LC_MESSAGES=C $MSGFMT --statistics -o /dev/null $dir"/"$LCODE".po" 2>&1`
@ -111,31 +111,31 @@ for BRANCH in $TRUNK $BRANCHES; do
file=$DIR"/"`basename $dir`"."$LCODE".po"
if [ -f $dir"/"$LCODE".po" ]; then
if [ $(($u+$f)) == 0 ]; then
echo -e $GREEN"File is translated."; tput sgr0
echo -e $GREEN"File is translated."$ENDCOLOR
if [ -f $DIR"/"`basename $dir`"."$LCODE".po" ]; then
echo -e $GREEN"Removing from $DIR."; tput sgr0
echo -e $GREEN"Removing from $DIR."$ENDCOLOR
rm -f $file
fi
else
if [ -f "$DIR/"`basename $dir`".$LCODE.po" ]; then
echo -e $BLUE"Merging:"; tput sgr0
echo -e $BLUE"Merging:"$ENDCOLOR
$MSGMERGE -U -v $file $dir"/"`basename $dir`".pot"
rm -f $file~
else
echo -e $RED"Copying:"; tput sgr0
echo -e $RED"Copying:"$ENDCOLOR
cp $dir"/"$LCODE".po" $file
fi
fi
else
if [ ! -f $file ]; then
echo -e $RED"No po file in repository. Running msginit."; tput sgr0
echo -e $RED"No po file in repository. Running msginit."$ENDCOLOR
echo "$dir"
$MSGINIT -i "$dir/`basename $dir`.pot" -o $file
else
echo -e $RED"No po file in repository. Found file in workspace."; tput sgr0
echo -e $RED"No po file in repository. Found file in workspace."$ENDCOLOR
fi
fi
echo ""
done
done
echo -ne $GREEN"Finished."; tput sgr0; echo " "
echo -e $GREEN"Finished."$ENDCOLOR