From sfalcon at fhcrc.org  Mon Jul 10 21:02:32 2006
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Mon, 10 Jul 2006 12:02:32 -0700
Subject: [Rd] Add .git to SCM excludes for build and INSTALL scripts
Message-ID: <m2irm5th9z.fsf@fhcrc.org>

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
   done
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



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