Re: check-po a lynx



On Fri, May 01, 2009 at 10:07:59PM +0200, Pavol Šimo wrote:
> 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.

Super. Má to však dva problémy:

1. V prípade, že ani jeden z linxov nenájdeš, program pokračuje ďalej s
DUMP_COMMAND="", čo neskôr spôsobí problém. Chcelo by to test...

2. links je (môže byť) na rôznych systémoch rôzny. Príklad:

Fedora 10 (tu je links symlink na elinks):

$ links -version
ELinks 0.12pre2
Built on Oct  1 2008 05:51:00

Vlastnosti:
Standard, IPv6, gzip, bzip2, UTF-8, Periodic Saving, Viewer (Search
History, Timer, Marks), Cascading Style Sheets, Protocol
(Authentication, BitTorrent, File, FTP, HTTP, URI rewrite,
Užívateľské protokoly), SSL (OpenSSL), MIME (Option system,
Mailcap, Mimetypes files), LED indikátory, Záložky, Cookies, Form
History, Globálna história, Goto URL History



Solaris Nevada build 113 (tu je links samostatný program, iný ako elinks):

$ links -version
Links 1.00
$ links -dump-width=200
Unknown option -dump-width=200


Takže na Solarise to fungovať nebude. Navrhujem podporu pre links úplne
vyhodiť a nechať len lynx a elinks. Alebo otestovať, čo vráti "links
-version" a podľa toho sa zachovať. Čo Ty na to?


> 
> 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"
>  


-- 
+-------------------------------------------+
| Marcel Telka   e-mail:   marcel telka sk  |
|                homepage: http://telka.sk/ |
|                jabber:   marcel jabber sk |
+-------------------------------------------+


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