[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    www/areas/l10n/teams/el/scripts
From:       Spiros Georgaras <sngeorgaras () otenet ! gr>
Date:       2009-07-28 7:40:59
Message-ID: 1248766859.765977.28448.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1003400 by sngeorgaras:

updating merge scripts

 M  +35 -14    l10n-merge  
 M             l10n-scripts.tar.bz2  


--- trunk/www/areas/l10n/teams/el/scripts/l10n-merge #1003399:1003400
@@ -26,8 +26,9 @@
 	echo " [options] <module>/<po file>"
 	echo
 	echo "Valid options are:"
-	echo "  -s  merge from stable branch"
+	echo "  -s  merge from stable branch (stable -> trunk)"
 	echo "      normally $(basename "$0") merges from trunk branch"
+  echo "      (trunk -> stable)"
 	echo "  -n  execute no sanity checks"
 	echo "  -h  display this screen and exit"
 	echo
@@ -98,7 +99,7 @@
 	esac
 done
 shift $(($OPTIND - 1))
-
+# set -x
 if [ $# -eq 0 ];then
 	help
 	exit 1
@@ -108,9 +109,15 @@
 	if [ "$MODULE" = "$PO" ];then
 		MODULE=$(basename "$PWD")
 		PO="$1"
-	fi	
+	fi
+elif [ $# -eq 2 ];then
+  MODULE="$(echo "$1" | sed 's|/||g')"
+  PO="$2"
 fi
+# exit
 
+
+
 TMP=$(echo "$PO" | grep -e 'po$')
 if [ "$TMP" = "" ];then
 	echo "File \"$PO\" is not a valid po file"
@@ -146,8 +153,9 @@
 	exit 1
 fi
 
+noPO=''
 if [ ! -e "$workFolder"/"$MODULE"/"$PO" ];then
-	onPO=true
+	noPO=true
 	if [ ! -e "$potFolder"/"$MODULE"/"$POT" ];then
 		echo "File \"$PO\" does not exist in brunch"
 		exit 1
@@ -163,16 +171,10 @@
 
 cd "$workFolder"/"$MODULE"
 if [ "$noPo" = "true" ];then
-	cp "$PO" "$tmpPO"
-else
-	echo -n "Merging $PO "
-	msgmerge "$poFolder"/"$MODULE"/"$PO" "$PO" -o "$tmpPO"
-	echo
+	cp "$potFolder"/"$MODULE"/"$POT" "$PO"
 fi
-
 echo -n "Merging $PO with POT "
-msgmerge "$tmpPO" "$potFolder"/"$MODULE"/"$POT" -o "$newPO"
-rm "$tmpPO"
+msgmerge "$PO" -C "$poFolder"/"$MODULE"/"$PO" "$potFolder"/"$MODULE"/"$POT" -o \
"$newPO"  echo
 
 DIFF=`diff "$PO" "$newPO"`
@@ -180,6 +182,25 @@
 	rm "$newPO"
 	echo "No file has been saved in \"$PWD\""
 else
-	echo "New file: \"$PWD/$newPO\""
+# # 	echo "New file: \"$PWD/$newPO\""
+#   statPO="$(msgfmt --statistics -o /dev/null "$PO" 2>&1)"
+#   translated="$(echo "$statPO" | sed '/translated/s|\([0-9][0-9]*\) \
translated.*|\1|')" +#   if [ -n "$(echo "$translated" | grep -e '\.$')" ];then \
translated=0;fi +#   fuzzy="$(echo "$statPO" | sed '/fuzzy/s|.*, \([0-9][0-9]*\) \
fuzzy.*|\1|')" +#   if [ -n "$(echo "$fuzzy" | grep -e '\.$')" ];then fuzzy=0;fi
+#   untranslated="$(echo "$statPO" | sed '/untranslated/s|.*, \([0-9][0-9]*\) \
untranslated.*|\1|')" +#   if [ -n "$(echo "$untranslated" | grep -e '\.$')" ];then \
untranslated=0;fi +#   allMsg=$(echo "$translated + $fuzzy + $untranslated" | bc)
+#   printf "%4s translated, %4s fuzzy, %4s untranslated, %4s total - %s\n" \
$translated $fuzzy $untranslated $allMsg $PO +#   statNewPO="$(msgfmt --statistics -o \
/dev/null "$newPO" 2>&1)" +#   translatedNew="$(echo "$statNewPO" | sed \
'/translated/s|\([0-9][0-9]*\) translated.*|\1|')" +#   if [ -n "$(echo \
"$translatedNew" | grep -e '\.$')" ];then translatedNew=0;fi +#   fuzzyNew="$(echo \
"$statNewPO" | sed '/fuzzy/s|.*, \([0-9][0-9]*\) fuzzy.*|\1|')" +#   if [ -n "$(echo \
"$fuzzyNew" | grep -e '\.$')" ];then fuzzyNew=0;fi +#   untranslatedNew="$(echo \
"$statNewPO" | sed '/untranslated/s|.*, \([0-9][0-9]*\) untranslated.*|\1|')" +#   if \
[ -n "$(echo "$untranslatedNew" | grep -e '\.$')" ];then untranslatedNew=0;fi +#   \
allMsgNew=$(echo "$translatedNew + $fuzzyNew + $untranslatedNew" | bc) +#   printf \
"%4s translated, %4s fuzzy, %4s untranslated, %4s total - %s\n" $translatedNew \
$fuzzyNew $untranslatedNew $allMsgNew $newPO +  mv "$newPO" "$PO"
 fi
-echo
+


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic