diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-03-02 15:59:12 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-03-02 15:59:12 +0000 |
commit | 06a7b5647e11a8ddf69b1c3d3ded6a8ba28b923e (patch) | |
tree | 8d58c1f4b049da677b33209b072f2b3057268fe0 /eclass/vcs-clean.eclass | |
parent | 99abbc5e5a6ecd3fc981b45646fd8cb5d320377b (diff) |
gentoo resync : 02.03.2018
Diffstat (limited to 'eclass/vcs-clean.eclass')
-rw-r--r-- | eclass/vcs-clean.eclass | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/eclass/vcs-clean.eclass b/eclass/vcs-clean.eclass new file mode 100644 index 000000000000..649a9e3039b1 --- /dev/null +++ b/eclass/vcs-clean.eclass @@ -0,0 +1,40 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: vcs-clean.eclass +# @MAINTAINER: +# base-system@gentoo.org +# @AUTHOR: +# Benedikt Böhm <hollow@gentoo.org> +# @BLURB: helper functions to remove VCS directories + +# @FUNCTION: ecvs_clean +# @USAGE: [list of dirs] +# @DESCRIPTION: +# Remove CVS directories and .cvs* files recursively. Useful when a +# source tarball contains internal CVS directories. Defaults to ${PWD}. +ecvs_clean() { + [[ $# -eq 0 ]] && set -- . + find "$@" '(' -type d -name 'CVS' -prune -o -type f -name '.cvs*' ')' \ + -exec rm -rf '{}' + +} + +# @FUNCTION: esvn_clean +# @USAGE: [list of dirs] +# @DESCRIPTION: +# Remove .svn directories recursively. Useful when a source tarball +# contains internal Subversion directories. Defaults to ${PWD}. +esvn_clean() { + [[ $# -eq 0 ]] && set -- . + find "$@" -type d -name '.svn' -prune -exec rm -rf '{}' + +} + +# @FUNCTION: egit_clean +# @USAGE: [list of dirs] +# @DESCRIPTION: +# Remove .git* directories recursively. Useful when a source tarball +# contains internal Git directories. Defaults to ${PWD}. +egit_clean() { + [[ $# -eq 0 ]] && set -- . + find "$@" -type d -name '.git*' -prune -exec rm -rf '{}' + +} |