The bzr, darcs, git, and hg version control systems use a single internal folder at the root to store all VCS-related data (commits, history, etc.). This folder can get quite large (hundreds of MiB) for big projects and continues to grow as the project lives on. We exclude this folder when creating a temporary build directory to save time and space. Since commit 0e79802c0ac8453376d8c0f99629f5a3b499f571 in pacman includes "shopt -s extglob" in pacman/scripts/makepkg.sh.in, we can use the simple "!(foo)" syntax. Thanks to Dave Reisner for pointing this out. [1] CVS and SVN pollute the source repo with "CVS" and ".svn" directories recursively for every single directory, so we use rsync. Most, if not all, Arch systems should have rsync installed, so this should be safe. [1]: http://mailman.archlinux.org/pipermail/arch-projects/2011-November/002033.ht... Signed-off-by: Linus Arver <linusarver@gmail.com> --- prototypes/PKGBUILD-bzr.proto | 3 ++- prototypes/PKGBUILD-cvs.proto | 2 +- prototypes/PKGBUILD-darcs.proto | 3 ++- prototypes/PKGBUILD-hg.proto | 3 ++- prototypes/PKGBUILD-svn.proto | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/prototypes/PKGBUILD-bzr.proto b/prototypes/PKGBUILD-bzr.proto index 287486d..745414c 100644 --- a/prototypes/PKGBUILD-bzr.proto +++ b/prototypes/PKGBUILD-bzr.proto @@ -47,7 +47,8 @@ build() { msg "Starting build..." rm -rf "$_bzrmod-build" - cp -r "$_bzrmod" "$_bzrmod-build" + mkdir "$_bzrmod-build" + cp -a "$_bzrmod"/!(.bzr) "$_bzrmod-build" cd "$_bzrmod-build" # diff --git a/prototypes/PKGBUILD-cvs.proto b/prototypes/PKGBUILD-cvs.proto index 0ddd91d..4cf87cc 100644 --- a/prototypes/PKGBUILD-cvs.proto +++ b/prototypes/PKGBUILD-cvs.proto @@ -47,7 +47,7 @@ build() { msg "Starting build..." rm -rf "$_cvsmod-build" - cp -r "$_cvsmod" "$_cvsmod-build" + rsync -a --exclude=CVS "$_cvsmod"/* "$_cvsmod-build" cd "$_cvsmod-build" # diff --git a/prototypes/PKGBUILD-darcs.proto b/prototypes/PKGBUILD-darcs.proto index 1103588..4ab19f5 100644 --- a/prototypes/PKGBUILD-darcs.proto +++ b/prototypes/PKGBUILD-darcs.proto @@ -47,7 +47,8 @@ build() { msg "Starting build..." rm -rf "$_darcsmod-build" - cp -r "$_darcsmod" "$_darcsmod-build" + mkdir "$_darcsmod-build" + cp -a "$_darcsmod"/!(_darcs) "$_darcsmod-build" cd "$_darcsmod-build" # diff --git a/prototypes/PKGBUILD-hg.proto b/prototypes/PKGBUILD-hg.proto index e2ddca1..9168deb 100644 --- a/prototypes/PKGBUILD-hg.proto +++ b/prototypes/PKGBUILD-hg.proto @@ -47,7 +47,8 @@ build() { msg "Starting build..." rm -rf "$_hgrepo-build" - cp -r "$_hgrepo" "$_hgrepo-build" + mkdir "$_hgrepo-build" + cp -a "$_hgrepo"/!(.hg) "$_hgrepo-build" cd "$_hgrepo-build" # diff --git a/prototypes/PKGBUILD-svn.proto b/prototypes/PKGBUILD-svn.proto index 42f7f60..2f6438a 100644 --- a/prototypes/PKGBUILD-svn.proto +++ b/prototypes/PKGBUILD-svn.proto @@ -47,7 +47,7 @@ build() { msg "Starting build..." rm -rf "$_svnmod-build" - cp -r "$_svnmod" "$_svnmod-build" + rsync -a --exclude=.svn "$_svnmod"/* "$_svnmod-build" cd "$_svnmod-build" # -- 1.7.7.3