[Rd] ???UNSURE??? Re: (PR#8363) R CMD INSTALL fails if cd prints

p.lijnzaad@med.uu.nl p.lijnzaad at med.uu.nl
Wed Dec 7 13:34:55 CET 2005


On Monday 05 December 2005 14:28, Prof Brian Ripley wrote:
> >> What shells are these?
> >
> > Bash, mostly, but also ksh and zsh; sorry for not mentioning this.
>
> I still don't know what you did to be able to reproduce this (and I did
> ask).  

It turns ou that I was not quite correct regarding the cause of cd printing 
the 'new' directory. It is due to having the CDPATH set. If it is,
the POSIX standard requires 'cd' to print to stdout the new directory.
So to reproduce, run a bash  or ksh shell,  and do 

  CDPATH='.:..'               # a commonly used value for $CDPATH
  R CMD INSTALL SomePackage

> And as it is a shell script running under /bin/sh, it must be 
> whatever is masquerading as Bourne shell on your system(s) that is
> affected.

yes; it is fairly common for Linux systems to have have /bin/sh be a symlink 
to /bin/bash (which I'm not sure is always a good idea). But the issue will 
affect any POSIX-compliant shell.

> But it _is_ so required:
>
> http://www.opengroup.org/onlinepubs/009695399/utilities/cd.html

Sorry, I missed that. And I agree that it's the most logical thing to do when 
cd fails. 

> How old are `older SunOSes'?  Solaris 8 (which is 4 years old) is
> POSIX-compilant here, and I would be surprised if any from the last decade
> was not (at least with suitable paths set).

SunOS 5.7 (which admittedly is ancient; I can't find the year, google.com is 
currently unreachable for me) doesn't do it.

> Our philosphy is to assume that the users tools are standard (e.g. POSIX)
> unless there is widespread evidence to the contrary.  

The  INSTALL.in script already contains various '> /dev/null'; my patch just 
adds another two, inside the get_packages function, just to avoid any output 
that the cd-command might happen to have. I would not have thought this to be 
so controversial. Regards,

                                                                       Philip

-- 
Philip Lijnzaad
Genomics Laboratory
Dept. of Biomedical Genetics
University Medical Center (UMC), Utrecht
Stratenum room 2.201 (on Mondays and Thursdays not in after 14.45)
MSN chat (*NOT* email): philip_lijnzaad at hotmail.com
P.O. Box 85060, 3508 AB Utrecht
(Universiteitsweg 100, 3584 CG Utrecht)
The Netherlands
tel: +31 (0)30 253 8464
fax: +31 (0)30 253 8479



More information about the R-devel mailing list