Full_Name: Byron Ellis Version: R 1.9.0 (and 2.0.0) OS: Linux (Redhat Fedora Core) Submission from: (NULL) (140.247.241.197) It appears that `R CMD build` cannot handle spaces in the path when building packages for distribution. For instance: [ellis@net-78815 ~/Bayesian Networks]$ R CMD build bnsl * checking for file 'bnsl/DESCRIPTION' ... OK * preparing 'bnsl': * cleaning src * removing junk files * building 'bnsl_0.0.1.tar.gz' tar: Networks/bnsl_0.0.1.tar: Cannot stat: No such file or directory tar: Error exit delayed from previous errors tar: Networks/bnsl_0.0.1.tar: Not found in archive tar: Error exit delayed from previous errors Error: cannot open file 'bnsl/DESCRIPTION' for reading [ellis@net-78815 ~/Bayesian Networks]$ Results in a file named "Bayesian" (that appears to be the uncompressed tar file) in ~/. I suspect some missing quotes somewhere.
'R CMD build' fails when there are spaces in the path (PR#6830)
6 messages · Byron Ellis, Brian Ripley, Kurt Hornik +1 more
ellis writes:
Full_Name: Byron Ellis Version: R 1.9.0 (and 2.0.0) OS: Linux (Redhat Fedora Core) Submission from: (NULL) (140.247.241.197)
It appears that `R CMD build` cannot handle spaces in the path when building packages for distribution. For instance:
[ellis@net-78815 ~/Bayesian Networks]$ R CMD build bnsl * checking for file 'bnsl/DESCRIPTION' ... OK * preparing 'bnsl': * cleaning src * removing junk files * building 'bnsl_0.0.1.tar.gz' tar: Networks/bnsl_0.0.1.tar: Cannot stat: No such file or directory tar: Error exit delayed from previous errors tar: Networks/bnsl_0.0.1.tar: Not found in archive tar: Error exit delayed from previous errors Error: cannot open file 'bnsl/DESCRIPTION' for reading [ellis@net-78815 ~/Bayesian Networks]$
Results in a file named "Bayesian" (that appears to be the uncompressed tar file) in ~/. I suspect some missing quotes somewhere.
The problem definitely occurs when calling R CMD build from a dir whose
file path contains white space. Now in R CMD build we have
$ grep filepath build.in
my $filepath = &file_path($startdir, $filename);
R_system("zip -r9X $filepath.zip $pkgs $topLevelFiles");
R_system("$tar chf $filepath $pkgs $topLevelFiles");
R_system("gzip -9f $filepath");
my $filepath = &file_path($startdir, $filename);
my $origfilepath = $filepath;
$filepath =~ s+^([A-Za-x]):+/cygdrive/\1+;
R_system("$tar chf $filepath $pkgname");
R_system("$tar xhf $filepath");
R_system("$tar chf $filepath $pkgname");
R_system("gzip -9f $origfilepath");
so in fact in none of the calls to R_system() with $filepath do we
currently perform any kind of quoting or shell escaping.
A simple improvement would be quoting all filepaths in R_system() calls
via \"...\" or '...'. Unless someone has a better idea or wants to put
in more effort ...
-k
Note that it *does* work under Windows (via mapping names to short names without spaces), so we should take care not to break that (and I think adding quotes will as the shell quoting rules appear to be are different).
On Tue, 27 Apr 2004, Kurt Hornik wrote:
ellis writes:
Full_Name: Byron Ellis Version: R 1.9.0 (and 2.0.0) OS: Linux (Redhat Fedora Core) Submission from: (NULL) (140.247.241.197)
It appears that `R CMD build` cannot handle spaces in the path when building packages for distribution. For instance:
[ellis@net-78815 ~/Bayesian Networks]$ R CMD build bnsl * checking for file 'bnsl/DESCRIPTION' ... OK * preparing 'bnsl': * cleaning src * removing junk files * building 'bnsl_0.0.1.tar.gz' tar: Networks/bnsl_0.0.1.tar: Cannot stat: No such file or directory tar: Error exit delayed from previous errors tar: Networks/bnsl_0.0.1.tar: Not found in archive tar: Error exit delayed from previous errors Error: cannot open file 'bnsl/DESCRIPTION' for reading [ellis@net-78815 ~/Bayesian Networks]$
Results in a file named "Bayesian" (that appears to be the uncompressed tar file) in ~/. I suspect some missing quotes somewhere.
The problem definitely occurs when calling R CMD build from a dir whose
file path contains white space. Now in R CMD build we have
$ grep filepath build.in
my $filepath = &file_path($startdir, $filename);
R_system("zip -r9X $filepath.zip $pkgs $topLevelFiles");
R_system("$tar chf $filepath $pkgs $topLevelFiles");
R_system("gzip -9f $filepath");
my $filepath = &file_path($startdir, $filename);
my $origfilepath = $filepath;
$filepath =~ s+^([A-Za-x]):+/cygdrive/\1+;
R_system("$tar chf $filepath $pkgname");
R_system("$tar xhf $filepath");
R_system("$tar chf $filepath $pkgname");
R_system("gzip -9f $origfilepath");
so in fact in none of the calls to R_system() with $filepath do we
currently perform any kind of quoting or shell escaping.
A simple improvement would be quoting all filepaths in R_system() calls
via \"...\" or '...'. Unless someone has a better idea or wants to put
in more effort ...
Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Prof Brian Ripley writes:
Note that it *does* work under Windows (via mapping names to short names without spaces), so we should take care not to break that (and I think adding quotes will as the shell quoting rules appear to be are different).
I thought that R_system() would portably invoke a Bourne shell? -k
On Tue, 27 Apr 2004, Kurt Hornik wrote:
ellis writes:
Full_Name: Byron Ellis Version: R 1.9.0 (and 2.0.0) OS: Linux (Redhat Fedora Core) Submission from: (NULL) (140.247.241.197)
It appears that `R CMD build` cannot handle spaces in the path when building packages for distribution. For instance:
[ellis@net-78815 ~/Bayesian Networks]$ R CMD build bnsl * checking for file 'bnsl/DESCRIPTION' ... OK * preparing 'bnsl': * cleaning src * removing junk files * building 'bnsl_0.0.1.tar.gz' tar: Networks/bnsl_0.0.1.tar: Cannot stat: No such file or directory tar: Error exit delayed from previous errors tar: Networks/bnsl_0.0.1.tar: Not found in archive tar: Error exit delayed from previous errors Error: cannot open file 'bnsl/DESCRIPTION' for reading [ellis@net-78815 ~/Bayesian Networks]$
Results in a file named "Bayesian" (that appears to be the uncompressed tar file) in ~/. I suspect some missing quotes somewhere.
The problem definitely occurs when calling R CMD build from a dir whose
file path contains white space. Now in R CMD build we have
$ grep filepath build.in
my $filepath = &file_path($startdir, $filename);
R_system("zip -r9X $filepath.zip $pkgs $topLevelFiles");
R_system("$tar chf $filepath $pkgs $topLevelFiles");
R_system("gzip -9f $filepath");
my $filepath = &file_path($startdir, $filename);
my $origfilepath = $filepath;
$filepath =~ s+^([A-Za-x]):+/cygdrive/\1+;
R_system("$tar chf $filepath $pkgname");
R_system("$tar xhf $filepath");
R_system("$tar chf $filepath $pkgname");
R_system("gzip -9f $origfilepath");
so in fact in none of the calls to R_system() with $filepath do we
currently perform any kind of quoting or shell escaping.
A simple improvement would be quoting all filepaths in R_system() calls
via \"...\" or '...'. Unless someone has a better idea or wants to put
in more effort ...
-- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On Wed, 28 Apr 2004, Kurt Hornik wrote:
Prof Brian Ripley writes:
Note that it *does* work under Windows (via mapping names to short names without spaces), so we should take care not to break that (and I think adding quotes will as the shell quoting rules appear to be are different).
I thought that R_system() would portably invoke a Bourne shell?
No, it is ash on Windows, which is not quite Bourne.
-k
On Tue, 27 Apr 2004, Kurt Hornik wrote:
ellis writes:
Full_Name: Byron Ellis Version: R 1.9.0 (and 2.0.0) OS: Linux (Redhat Fedora Core) Submission from: (NULL) (140.247.241.197)
It appears that `R CMD build` cannot handle spaces in the path when building packages for distribution. For instance:
[ellis@net-78815 ~/Bayesian Networks]$ R CMD build bnsl * checking for file 'bnsl/DESCRIPTION' ... OK * preparing 'bnsl': * cleaning src * removing junk files * building 'bnsl_0.0.1.tar.gz' tar: Networks/bnsl_0.0.1.tar: Cannot stat: No such file or directory tar: Error exit delayed from previous errors tar: Networks/bnsl_0.0.1.tar: Not found in archive tar: Error exit delayed from previous errors Error: cannot open file 'bnsl/DESCRIPTION' for reading [ellis@net-78815 ~/Bayesian Networks]$
Results in a file named "Bayesian" (that appears to be the uncompressed tar file) in ~/. I suspect some missing quotes somewhere.
The problem definitely occurs when calling R CMD build from a dir whose
file path contains white space. Now in R CMD build we have
$ grep filepath build.in
my $filepath = &file_path($startdir, $filename);
R_system("zip -r9X $filepath.zip $pkgs $topLevelFiles");
R_system("$tar chf $filepath $pkgs $topLevelFiles");
R_system("gzip -9f $filepath");
my $filepath = &file_path($startdir, $filename);
my $origfilepath = $filepath;
$filepath =~ s+^([A-Za-x]):+/cygdrive/\1+;
R_system("$tar chf $filepath $pkgname");
R_system("$tar xhf $filepath");
R_system("$tar chf $filepath $pkgname");
R_system("gzip -9f $origfilepath");
so in fact in none of the calls to R_system() with $filepath do we
currently perform any kind of quoting or shell escaping.
A simple improvement would be quoting all filepaths in R_system() calls
via \"...\" or '...'. Unless someone has a better idea or wants to put
in more effort ...
-- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
______________________________________________ R-devel@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:
On Wed, 28 Apr 2004, Kurt Hornik wrote:
Prof Brian Ripley writes:
Note that it *does* work under Windows (via mapping names to short names without spaces), so we should take care not to break that (and I think adding quotes will as the shell quoting rules appear to be are different).
I thought that R_system() would portably invoke a Bourne shell?
No, it is ash on Windows, which is not quite Bourne.
Well, at least it isn't CMD.EXE. Enclosing things in double quotes does seem to work with ash (at least what RedHat calls ash): $ X="abc def" $ cat > "$X" bla bla $ cat $X cat: abc: No such file or directory cat: def: No such file or directory $ cat "$X" bla bla BTW, I had the displeasure of having to use the ash command line recently (teaching compiling and package building on a system where the control freaks^W^Wsystem administrators had disabled CMD.EXE). Is there a better way?
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907