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. CVS and SVN pollute the source repo with "CVS" and ".svn" directories recursively for every single directory, so there is no simple one-liner solution to exclude the VCS data for these systems that I am aware of. 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 887d97b..8011314 100644 --- a/prototypes/PKGBUILD-bzr.proto +++ b/prototypes/PKGBUILD-bzr.proto @@ -46,7 +46,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 1d37621..269dbfc 100644 --- a/prototypes/PKGBUILD-cvs.proto +++ b/prototypes/PKGBUILD-cvs.proto @@ -46,7 +46,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 5da47e1..8d6909d 100644 --- a/prototypes/PKGBUILD-darcs.proto +++ b/prototypes/PKGBUILD-darcs.proto @@ -46,7 +46,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 27883f6..5aeb4f9 100644 --- a/prototypes/PKGBUILD-hg.proto +++ b/prototypes/PKGBUILD-hg.proto @@ -46,7 +46,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 9cb3426..4f2efde 100644 --- a/prototypes/PKGBUILD-svn.proto +++ b/prototypes/PKGBUILD-svn.proto @@ -46,7 +46,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.2