From: Benedikt Boehm Date: Wed, 20 Feb 2008 12:36:14 +0000 (+0000) Subject: add ecvs_clean and esvn_clean, bug #210708 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=43f22cdefa7f41e3a7ad38a81ef78699f0b9058e;p=gentoo.git add ecvs_clean and esvn_clean, bug #210708 --- diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 6508d905010b..0d86b7d732b3 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.297 2008/02/15 07:43:45 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.298 2008/02/20 12:36:14 hollow Exp $ # @ECLASS: eutils.eclass # @MAINTAINER: @@ -49,6 +49,27 @@ ebeep() { fi } +# @FUNCTION: ecvs_clean +# @USAGE: [more dirs ...] +# @DESCRIPTION: +# Remove CVS directories recursiveley. Useful when a source tarball contains +# internal CVS directories. +ecvs_clean() { + [[ $# -gt 0 ]] || set -- . + find "$@" -type d -name 'CVS' -prune -print0 | xargs -0 rm -rf + find "$@" -type f -name '.cvs*' -print0 | xargs -0 rm -rf +} + +# @FUNCTION: esvn_clean +# @USAGE: [more dirs ...] +# @DESCRIPTION: +# Remove .svn directories recursiveley. Useful when a source tarball contains +# internal Subversion directories. +esvn_clean() { + [[ $# -gt 0 ]] || set -- . + find "$@" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf +} + # Default directory where patches are located EPATCH_SOURCE="${WORKDIR}/patch" # Default extension for patches