From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30142 Path: news.gmane.org!not-for-mail From: Sanjoy Mahajan Newsgroups: gmane.comp.tex.context Subject: ctxtools.rb (was Re: Context 2006.08.08 released ) Date: Tue, 08 Aug 2006 21:56:42 +0100 Message-ID: References: <44D8EDB7.6020900@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1155070630 17387 80.91.229.2 (8 Aug 2006 20:57:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 8 Aug 2006 20:57:10 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 08 22:57:08 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1GAYdJ-00073w-22 for gctc-ntg-context-518@m.gmane.org; Tue, 08 Aug 2006 22:57:01 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6B9521FE2E; Tue, 8 Aug 2006 22:57:00 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11570-06-3; Tue, 8 Aug 2006 22:56:53 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 170231FE23; Tue, 8 Aug 2006 22:56:53 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 43A3F1FE23 for ; Tue, 8 Aug 2006 22:56:49 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11570-06-2 for ; Tue, 8 Aug 2006 22:56:44 +0200 (CEST) Original-Received: from mraos.ra.phy.cam.ac.uk (mraos.ra.phy.cam.ac.uk [131.111.48.8]) by ronja.ntg.nl (Postfix) with SMTP id 377C61FE21 for ; Tue, 8 Aug 2006 22:56:44 +0200 (CEST) Original-Received: from skye.ra.phy.cam.ac.uk ([131.111.48.158] ident=mail) by mraos.ra.phy.cam.ac.uk with esmtp (Exim 4.43) id 1GAYd0-0002VB-Ti; Tue, 08 Aug 2006 21:56:42 +0100 Original-Received: from sanjoy by skye.ra.phy.cam.ac.uk with local (Exim 3.36 #1) id 1GAYd0-0005Rh-00; Tue, 08 Aug 2006 21:56:42 +0100 Original-To: mailing list for ConTeXt users In-Reply-To: Your message of "Tue, 08 Aug 2006 22:01:59 +0200." <44D8EDB7.6020900@wxs.nl> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:30142 Archived-At: Hans, The latest ctxtools.rb has: def locatedlocaltree tree = `kpsewhich --expand-path $TEXMFLOCAL`.chomp rescue nil unless tree && FileTest.directory?(tree) then tree = `kpsewhich --expand-path $TEXMF`.chomp rescue nil end return tree end I know the Windows/Unix quoting isn't sorted out, but another problem is with --expand-path. If the kpsewhich --expand-path $TEXMF line would get run here (with '$TEXMF'), it would produce /home/sanjoy/.texmf-config:/home/sanjoy/.texmf-var:/home/sanjoy/texmf:/etc/texmf:/var/lib/texmf:/usr/local/share/texmf:/usr/share/texmf:/usr/share/texmf-tetex which would eventually become the argument of an unhappy Dir.chdir(). Should localtedlocaltree() extract the first component before doing 'return tree'? -Sanjoy `Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.