From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/29754 Path: news.gmane.org!not-for-mail From: Sanjoy Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: updating context on Ubuntu 6.06 Date: Thu, 27 Jul 2006 13:37:11 +0100 Message-ID: References: <44C87399.1050805@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 1154003964 15945 80.91.229.2 (27 Jul 2006 12:39:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 Jul 2006 12:39:24 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Jul 27 14:39:22 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 1G6592-0002Qh-OU for gctc-ntg-context-518@m.gmane.org; Thu, 27 Jul 2006 14:39:16 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 63DF81FDCE; Thu, 27 Jul 2006 14:39:16 +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 17200-06; Thu, 27 Jul 2006 14:39:15 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7CE101FE69; Thu, 27 Jul 2006 14:37:18 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B366C1FE68 for ; Thu, 27 Jul 2006 14:37:14 +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 17337-07-2 for ; Thu, 27 Jul 2006 14:37:13 +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 E99FB1FE64 for ; Thu, 27 Jul 2006 14:37:12 +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 1G6571-0000yi-FP; Thu, 27 Jul 2006 13:37:11 +0100 Original-Received: from sanjoy by skye.ra.phy.cam.ac.uk with local (Exim 3.36 #1) id 1G6571-0003su-00; Thu, 27 Jul 2006 13:37:11 +0100 Original-To: mailing list for ConTeXt users In-Reply-To: Your message of "Thu, 27 Jul 2006 10:04:41 +0200." <44C87399.1050805@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:29754 Archived-At: > > It was hard to find a machine not running bash, a measure of the > > success of free software. But I eventually found a nearby Solaris > > > more a measure of the lack of diversity ... imagine everyone living a > house of the same design, driving the same car, etc etc Or instead walking, cycling, or taking public transit...but I dream. > can you try: ... I ran this ruby script (on Linux): 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 print locatedlocaltree+"\n" and got the error due to lack of quotes around $TEXMF{,LOCAL}: kpsewhich: option `--expand-path' requires an argument kpsewhich: option `--expand-path' requires an argument Unix definitely needs those quotes to protect the variables in the backquoted command from the shell. Also the 'rescue nil' doesn't seem to have any effect. Probably similar to system(), the `cmd` construct doesn't raise an exception if the command fails or even isn't found. Instead you get tree equal to the empty string, since `` captures (the empty) stdout. Is path expansion (instead of variable expansion) a risky change? It might make tree a colon-separated list. That will cause trouble for the directory test in the 'unless' clause, and also break later uses of the returned value of locatedlocaltree that assume it is one path element. -Sanjoy `Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.