commit:     38e617b4cd65d8ec69c0c255d68d4e06e488c0d6
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 22 19:21:29 2016 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Fri Jan 22 21:03:03 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38e617b4

eutils.eclass: Add egit_clean()

Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 eclass/eutils.eclass | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 13bf1e6..68c2813 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -54,6 +54,16 @@ esvn_clean() {
        find "$@" -type d -name '.svn' -prune -print0 | xargs -0 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() {
+       [[ -z $* ]] && set -- .
+       find "$@" -type d -name '.git*' -prune -print0 | xargs -0 rm -rf
+}
+
 # @FUNCTION: estack_push
 # @USAGE: <stack> [items to push]
 # @DESCRIPTION:

Reply via email to