ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* problem in kpse.rb
@ 2006-09-17  2:23 Johan Sandblom
  2006-09-17  3:13 ` Sanjoy Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Johan Sandblom @ 2006-09-17  2:23 UTC (permalink / raw)


Attempting to find out why this happened on linux

~$ texmfstart ctxtools --updatecontext
CtxTools | updating
CtxTools | unable to change to

I found that line 114 of kpse.rb can be changed from

path = run("--expand-path=\\\$#{varname}") rescue ''

to

path = run("--expand-path=\$#{varname}") rescue ''

which allows it to work, that is, the line should be the same under
windows and linux.

~$ ruby --version
ruby 1.8.4 (2005-12-24) [i486-linux]

Regards, Johan
-- 
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
"What is wanted is not the will to believe, but the
will to find out, which is the exact opposite"
- Bertrand Russell

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: problem in kpse.rb
  2006-09-17  2:23 problem in kpse.rb Johan Sandblom
@ 2006-09-17  3:13 ` Sanjoy Mahajan
  2006-09-17  7:45   ` Johan Sandblom
  0 siblings, 1 reply; 6+ messages in thread
From: Sanjoy Mahajan @ 2006-09-17  3:13 UTC (permalink / raw)


> path = run("--expand-path=\\\$#{varname}") rescue ''
> 
> to
> 
> path = run("--expand-path=\$#{varname}") rescue ''

I also ran into this (a few weeks ago on the list) and the patch I
sent Hans after testing it on my Ubuntu Linux laptop was to use two
backslashes:

  run("--expand-path=\\$#{varname}")

so that Unix sees the command as, for example,

  kpsewhich --expand-path=\$TEXMFLOCAL

which prevents the shell from expanding TEXMFLOCAL as a shell or
environment variable, leaving it for kpse to find it in texmf.cnf.
Interesting that \$ also works.  I guess the \ gets passed unchanged,
so the $ still gets procted from the shell.

By the way, the rescue '' doesn't do anything, since a failed run of
kpsewhich doesn't throw an exception.  I think I have a patch for
that.

Hans, should I resend those patches?

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
         --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: problem in kpse.rb
  2006-09-17  3:13 ` Sanjoy Mahajan
@ 2006-09-17  7:45   ` Johan Sandblom
  2006-09-17  9:02     ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Johan Sandblom @ 2006-09-17  7:45 UTC (permalink / raw)


Disappointingly, over here it doesn't work with two backslashes, only
with one. Possibly because there are two texmf.cnf (minimal linux
distro) which give different answers:

./texmf/web2c/texmf.cnf, which claims
% A place for local additions to a "standard" texmf tree.
% This tree is not used for local configuration maintained by
% texconfig, it uses TEXMFCONFIG below.
TEXMFLOCAL = $SELFAUTOPARENT/../texmf-local

and
./texmf-local/web2c/texmf.cnf, which claims
TEXMFMAIN     = $SELFAUTOPARENT/texmf
TEXMFLOCAL    = $SELFAUTOPARENT/texmf-local
TEXMFFONTS    = $SELFAUTOPARENT/texmf-fonts

Regards, Johan


2006/9/17, Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk>:
> > path = run("--expand-path=\\\$#{varname}") rescue ''
> >
> > to
> >
> > path = run("--expand-path=\$#{varname}") rescue ''
>
> I also ran into this (a few weeks ago on the list) and the patch I
> sent Hans after testing it on my Ubuntu Linux laptop was to use two
> backslashes:
>
>   run("--expand-path=\\$#{varname}")
>
> so that Unix sees the command as, for example,
>
>   kpsewhich --expand-path=\$TEXMFLOCAL
>
> which prevents the shell from expanding TEXMFLOCAL as a shell or
> environment variable, leaving it for kpse to find it in texmf.cnf.
> Interesting that \$ also works.  I guess the \ gets passed unchanged,
> so the $ still gets procted from the shell.
>
> By the way, the rescue '' doesn't do anything, since a failed run of
> kpsewhich doesn't throw an exception.  I think I have a patch for
> that.
>
> Hans, should I resend those patches?
>
> -Sanjoy
>
> `Never underestimate the evil of which men of power are capable.'
>          --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>


-- 
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
"What is wanted is not the will to believe, but the
will to find out, which is the exact opposite"
- Bertrand Russell

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: problem in kpse.rb
  2006-09-17  7:45   ` Johan Sandblom
@ 2006-09-17  9:02     ` Taco Hoekwater
  2006-09-17  9:12       ` Johan Sandblom
  2006-09-17 14:11       ` Hans Hagen
  0 siblings, 2 replies; 6+ messages in thread
From: Taco Hoekwater @ 2006-09-17  9:02 UTC (permalink / raw)


Johan Sandblom wrote:
>>I also ran into this (a few weeks ago on the list) and the patch I
>>sent Hans after testing it on my Ubuntu Linux laptop was to use two
>>backslashes:
>>
>>  run("--expand-path=\\$#{varname}")

My suggestion would be:

run("--expand-path='$#{varname}'")

Taco

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: problem in kpse.rb
  2006-09-17  9:02     ` Taco Hoekwater
@ 2006-09-17  9:12       ` Johan Sandblom
  2006-09-17 14:11       ` Hans Hagen
  1 sibling, 0 replies; 6+ messages in thread
From: Johan Sandblom @ 2006-09-17  9:12 UTC (permalink / raw)
  Cc: mailing list for ConTeXt users

Yes, that works.

Johan

2006/9/17, Taco Hoekwater <taco@elvenkind.com>:
> Johan Sandblom wrote:
> >>I also ran into this (a few weeks ago on the list) and the patch I
> >>sent Hans after testing it on my Ubuntu Linux laptop was to use two
> >>backslashes:
> >>
> >>  run("--expand-path=\\$#{varname}")
>
> My suggestion would be:
>
> run("--expand-path='$#{varname}'")
>
> Taco
>


-- 
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
"What is wanted is not the will to believe, but the
will to find out, which is the exact opposite"
- Bertrand Russell

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: problem in kpse.rb
  2006-09-17  9:02     ` Taco Hoekwater
  2006-09-17  9:12       ` Johan Sandblom
@ 2006-09-17 14:11       ` Hans Hagen
  1 sibling, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2006-09-17 14:11 UTC (permalink / raw)


Taco Hoekwater wrote:
> Johan Sandblom wrote:
>   
>>> I also ran into this (a few weeks ago on the list) and the patch I
>>> sent Hans after testing it on my Ubuntu Linux laptop was to use two
>>> backslashes:
>>>
>>>  run("--expand-path=\\$#{varname}")
>>>       
>
> My suggestion would be:
>
> run("--expand-path='$#{varname}'")
>   
ok

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-09-17 14:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-17  2:23 problem in kpse.rb Johan Sandblom
2006-09-17  3:13 ` Sanjoy Mahajan
2006-09-17  7:45   ` Johan Sandblom
2006-09-17  9:02     ` Taco Hoekwater
2006-09-17  9:12       ` Johan Sandblom
2006-09-17 14:11       ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).