Seth Falcon
2006-Jul-10 19:02 UTC
[Rd] Add .git to SCM excludes for build and INSTALL scripts
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
Martin Maechler
2006-Jul-11 08:41 UTC
[Rd] Add .git to SCM excludes for build and INSTALL scripts
Thank you Seth, I've committed the changes (BTW: for some reason your patch did not cleanly apply to build.in). Regards, Martin>>>>> "Seth" == Seth Falcon <sfalcon at fhcrc.org> >>>>> on Mon, 10 Jul 2006 12:02:32 -0700 writes:Seth> Git is a source code management system like CVS, svn, arch, and Seth> others. Seth> It would be nice to add exclude support to R CMD build and INSTALL so Seth> that the .git subdir of an R package is handled appropriately. Seth> Here is a possible patch: [ .........]