commit:     b2b6ac0932d7214f17752e9b89a6603580a857e5
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 16 17:48:13 2018 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Mar  2 08:33:39 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2b6ac09

vcs-clean.eclass: Split off clean helpers from eutils.eclass.

Split off functions ecvs_clean, esvn_clean, and egit_clean into
a dedicated vcs-clean.eclass. No code changes.

For backwards compatibility, eutils inherits the new eclass in
existing EAPIs.

 eclass/eutils.eclass    | 34 ++--------------------------------
 eclass/vcs-clean.eclass | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 32 deletions(-)

diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 0a5bf385358..7840afbb77b 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -20,7 +20,8 @@ _EUTILS_ECLASS=1
 # implicitly inherited (now split) eclasses
 case ${EAPI:-0} in
 0|1|2|3|4|5|6)
-       inherit desktop epatch estack ltprune multilib preserve-libs 
toolchain-funcs
+       inherit desktop epatch estack ltprune multilib preserve-libs \
+               toolchain-funcs vcs-clean
        ;;
 esac
 
@@ -37,37 +38,6 @@ if ! declare -F eqawarn >/dev/null ; then
        }
 fi
 
-# @FUNCTION: ecvs_clean
-# @USAGE: [list of dirs]
-# @DESCRIPTION:
-# Remove CVS directories recursiveley.  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 recursiveley.  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/files recursiveley.  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 '{}' +
-}
-
 # @FUNCTION: emktemp
 # @USAGE: [temp dir]
 # @DESCRIPTION:

diff --git a/eclass/vcs-clean.eclass b/eclass/vcs-clean.eclass
new file mode 100644
index 00000000000..649a9e3039b
--- /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-sys...@gentoo.org
+# @AUTHOR:
+# Benedikt Böhm <hol...@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 '{}' +
+}

Reply via email to