[Rd] Add .git to SCM excludes for build and INSTALL scripts

From: Seth Falcon <sfalcon_at_fhcrc.org>
Date: Mon 10 Jul 2006 - 19:02:32 GMT

Git is a source code management system like CVS, svn, arch, and others.

It would be nice to add exclude support to R CMD build and INSTALL so that the .git subdir of an R package is handled appropriately.

Here is a possible patch:

diff --git a/src/scripts/INSTALL.in b/src/scripts/INSTALL.in index 75da9db..09e5ab5 100644
--- a/src/scripts/INSTALL.in

+++ b/src/scripts/INSTALL.in
@@ -863,7 +863,7 @@ do_install_source () {

   ## When installing from a source directory under version control, we
   ## should really exclude the subdirs CVS, .svn (Subversion) and
   ## .arch-ids (arch).

- for d in CVS .svn .arch-ids; do
+ for d in CVS .svn .arch-ids .git; do
     find "${R_PACKAGE_DIR}" -name ${d} -type d -prune \
       -exec rm -rf \{\} \; 2>/dev/null

diff --git a/src/scripts/build.in b/src/scripts/build.in index 15c9e0c..ee880d9 100755
--- a/src/scripts/build.in

+++ b/src/scripts/build.in
@@ -181,6 +181,7 @@ foreach my $pkg (@ARGV) {
        print EXCLUDE "$File::Find::name\n" if(-d $_ && /^CVS$/);
        print EXCLUDE "$File::Find::name\n" if(-d $_ && /^\.svn$/);
        print EXCLUDE "$File::Find::name\n" if(-d $_ && /^\.arch-ids$/);
+       print EXCLUDE "$File::Find::name\n" if(-d $_ && /^\.git$/);
        ## Windows DLL resource file
        push(@exclude_patterns, "^src/" . $pkgname . "_res\\.rc");
        my $filename = $File::Find::name;

 + seth

R-devel@r-project.org mailing list
Received on Tue Jul 11 05:05:37 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 11 Jul 2006 - 10:26:13 GMT.

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