From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/9347 Path: main.gmane.org!not-for-mail From: Simon Pepping Newsgroups: gmane.comp.tex.context Subject: Re: getting context's version Date: Sat, 21 Sep 2002 19:29:26 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <20020921192925.A388@scaprea> References: <20020919204127.A861@scaprea> <20020918114734.404ff990.taco@elvenkind.com> <20020919204127.A861@scaprea> <5.1.0.14.1.20020520105456.01fd7cd8@server-1> <3D8AEB4B.A13D28E8@gmx.de> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="uAKRQypu60I7Lcqm" X-Trace: main.gmane.org 1035399682 2428 80.91.224.250 (23 Oct 2002 19:01:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 19:01:22 +0000 (UTC) Original-To: ntg-context@ntg.nl In-Reply-To: <3D8AEB4B.A13D28E8@gmx.de>; from burnus@gmx.de on Fri, Sep 20, 2002 at 11:32:59AM +0200 Xref: main.gmane.org gmane.comp.tex.context:9347 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:9347 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii On Fri, Sep 20, 2002 at 11:32:59AM +0200, Tobias Burnus wrote: > Hi, > > How about adding a check whether cont-?? exists before calling texexec? > (de, cz etc. are also missing) The attached finds the languages that are installed on your system, and prints their version lines. The %languages association needs editing. -- Simon Pepping email: spepping@scaprea.hobby.nl --uAKRQypu60I7Lcqm Content-Type: application/x-perl Content-Disposition: attachment; filename="context-versions.pl" use strict; my $debug; # $debug = 1; sub AnalyzeVersion { my ($fh, @targets) = @_; print "targets: @targets\n" if $debug; while (my $line = <$fh>) { for my $i (0 .. @targets-1) { if ($line =~ /^\s*(.*$targets[$i].*?)\s*$/o) { PrintVersion($targets[$i], $1); splice(@targets, $i, 1); last; } } my @lines = <$fh> unless @targets; } } sub PrintVersion { my ($target, $version) = @_; printf "%-10s: %s\n", $target, $version; } my %languages = (en => 'english', nl => 'dutch', de => 'german', cz => 'czech', pl => 'polish', ); my @interfaces = grep { my $fmt; chomp($fmt = `kpsewhich cont-$_.efmt`); $fmt } grep {$_ ne 'en'} keys %languages; open (TEX,">texexec.tex") ; print TEX "\\starttext test \\stoptext" ; close (TEX) ; unlink ("texexec.tui") ; unlink ("texexec.tuo") ; open (LOG, "texexec --interface=en texexec.tex |"); AnalyzeVersion(*LOG{IO}, qw(TeXExec TeXUtil pdfTeX pdfeTeX), $languages{en}); close LOG; for my $if (@interfaces) { open (LOG, "texexec --once --interface=$if texexec.tex |"); AnalyzeVersion(*LOG{IO}, $languages{$if}); close LOG; } --uAKRQypu60I7Lcqm--