[Rd] dos-style line endings in .Rbuildignore result in files not being excluded

From: Tony Plate <tplate_at_acm.org>
Date: Mon, 13 Oct 2008 23:10:41 -0600


I was trying, on a Linux system, to get a .Rbuildignore file to work. After far too long, I found the problem was the <CR><NL> line endings in the .Rbuildignore file -- I had originally created it on a Windows system, and emacs in Ubuntu was politely hiding that fact from me. The patterns didn't work to exclude files because it was trying to match filenames to patterns like "NOTES.txt^M".

I don't know what the best solution to this is, but I got it working by putting a substitute command in the bin/build file like this:

        while(<RBUILDIGNORE>) {
            chomp;
            s/^M$//;
            push(@exclude_patterns, $_) if $_;

(When I cut and paste that code here it ends up as two separate characters ^ and M, but in the bin/build file it's one <CR> character.)

One could of course say it is stupid user error to have <CR>'s in the .Rbuildignore file, but it can happen easily, and it would nice if R would work with it.

Could a fix for this little problem be incorporated into R?

thanks,

Tony Plate



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue 14 Oct 2008 - 05:12:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 14 Oct 2008 - 08:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive