eutils.eclass: Add egit_clean()
authorJustin Lecher <jlec@gentoo.org>
Fri, 22 Jan 2016 19:21:29 +0000 (20:21 +0100)
committerJustin Lecher <jlec@gentoo.org>
Fri, 22 Jan 2016 21:03:03 +0000 (22:03 +0100)
Signed-off-by: Justin Lecher <jlec@gentoo.org>
eclass/eutils.eclass

index 13bf1e6cc6374d90079d1335b3851ef1f079b749..68c28138cce11be176897f24c9f17fe0559c911f 100644 (file)
@@ -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: