[tex-live] TL current version

Reinhard Kotucha reinhard.kotucha at web.de
Sat May 5 16:17:04 CEST 2012


On 2012-05-05 at 10:47:08 +0200, Herbert Voss wrote:

 > For an install script I need the current version
 > of TeXLive.
 > Is there an easier way than
 > 
 > wget -qO- http://tug.org/texlive/ | grep -i "current release:" | cut -d" 
 > " -f5
 > 
 > which will be "2011"

Hi Herbert,
it's better to derive it from the distribution itself, maybe even 
from the server you intend to install from.

Furthermore, I think that machine-readable files are more reliable
for this purpose due to their well-defined syntax.

------------------------------------------------------------
#!/bin/sh

TLNET='http://ctan.org/tex-archive/systems/texlive/tlnet'
TLCONFIG="${TLNET}/tlpkg/TeXLive/TLConfig.pm"

wget -O- -q ${TLCONFIG} |
   sed -ne '/^ *\$ReleaseYear *=/s/.*= *\([0-9]*\) *;$/\1/p'
------------------------------------------------------------

I've made whitespace characters optional here because they are
optional in Perl.  Optional line breaks are not supported though.
However, I don't expect any changes to the coding style anyway.

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha                                      Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                              mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------


More information about the tex-live mailing list