Re: check-po a lynx



Ahoj.

> To je dobrý nápad. Skús to naimplementovať. Rád to potom zaintegrujem do
> "oficiálneho" check-po.

Pripájam patch pre aktuálny check-po. Zatiaľ je tam naozaj len ten
lynx/links/elinks.

Paľo
--- check-po.orig	2009-04-28 07:23:57.000000000 +0200
+++ check-po	2009-05-01 13:48:04.000000000 +0200
@@ -52,6 +52,29 @@
 		;;
 esac
 	
+DUMP_COMMAND=
+DUMP_COMMAND_WIDTH=
+for agent in lynx links elinks ; do
+	which $agent > /dev/null 2>&1
+	if test $? -eq 0 ; then
+		DUMP_COMMAND="$agent -dump"
+		break
+	fi
+done
+# I don't know if this is needed for lynx, it is correct for links...
+case $DUMP_COMMAND in
+	links*|elinks*)
+		USER_FULLNAME_IDX=15
+		USER_EMAIL_IDX=16
+		DUMP_COMMAND_WIDTH=-dump-width=200
+		;;
+	*)
+		USER_FULLNAME_IDX=14
+		USER_EMAIL_IDX=15
+		DUMP_COMMAND_WIDTH=-width=200
+		;;
+esac
+
 #---------------------------------------------------------
 
 test $# -lt 1 && printf "ERROR: Missing arguments!\n\n" && usage 2
@@ -107,7 +130,7 @@
 	echo "Vertimus"
 	echo "========"
 
-	lynx $URL -dump -width=200 > $TMPDIR/vertimus
+	$DUMP_COMMAND $URL $DUMP_COMMAND_WIDTH > $TMPDIR/vertimus
 	UPLOAD=`cat $TMPDIR/vertimus | $GEGREP -B 2 -A 1 "^ *\[[0-9]*\]\[download.png\].*merged\.po$" | tail -4`
 	printf "Check for PO file availability... "
 	test `echo "$UPLOAD" | wc -l` -ne 4 && fatal "PO file is not available on Vertimus page"
@@ -193,9 +216,9 @@
 	WIKI_FULLNAME=`echo $TRANS | sed -e 's,\[\[http://l10n\.gnome\.org/users/[^/]*/|\([^]]*\)\]\]$,\1,'`
 	echo "Full name: $WIKI_FULLNAME"
 
-	lynx http://l10n.gnome.org/users/$WIKI_USER -dump > $TMPDIR/wiki-user
-	USER_FULLNAME=`cat $TMPDIR/wiki-user | egrep "^ *\[14\]" | sed -e 's/^ *\[14\]//'`
-	USER_EMAIL=`cat $TMPDIR/wiki-user | egrep "^ *\[15\]" | sed -e 's/^ *\[15\]//' | sed -e 's/ dot /./g' -e 's/ at /@/g'`
+	$DUMP_COMMAND http://l10n.gnome.org/users/$WIKI_USER > $TMPDIR/wiki-user
+	USER_FULLNAME=`cat $TMPDIR/wiki-user | egrep "^ *\[$USER_FULLNAME_IDX\]" | sed -e "s/^ *\[$USER_FULLNAME_IDX\]//"`
+	USER_EMAIL=`cat $TMPDIR/wiki-user | egrep "^ *\[$USER_EMAIL_IDX\]" | sed -e "s/^ *\[$USER_EMAIL_IDX\]//" | sed -e 's/ dot /./g' -e 's/ at /@/g'`
 	echo "User full name: $USER_FULLNAME"
 	echo "User e-mail: $USER_EMAIL"
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]