From tplate at acm.org  Tue Oct 14 07:10:41 2008
From: tplate at acm.org (Tony Plate)
Date: Mon, 13 Oct 2008 23:10:41 -0600
Subject: [Rd] dos-style line endings in .Rbuildignore result in files not
 being excluded
Message-ID: <48F429D1.6040500@acm.org>

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



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