diff options
author | Justin Lecher <jlec@gentoo.org> | 2016-01-22 20:21:29 +0100 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2016-01-22 22:03:03 +0100 |
commit | 38e617b4cd65d8ec69c0c255d68d4e06e488c0d6 (patch) | |
tree | 970818a44977df56de51106a5c343eb9da573c95 /eclass | |
parent | 0dbd28d2e94105b4faaea44fc578ecbc8874efb4 (diff) | |
download | gentoo-38e617b4cd65d8ec69c0c255d68d4e06e488c0d6.tar.gz gentoo-38e617b4cd65d8ec69c0c255d68d4e06e488c0d6.tar.xz |
eutils.eclass: Add egit_clean()
Signed-off-by: Justin Lecher <jlec@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/eutils.eclass | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 13bf1e6cc63..68c28138cce 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: |