From b2b6ac0932d7214f17752e9b89a6603580a857e5 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Fri, 16 Feb 2018 18:48:13 +0100 Subject: 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/vcs-clean.eclass | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 eclass/vcs-clean.eclass (limited to 'eclass/vcs-clean.eclass') 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-system@gentoo.org +# @AUTHOR: +# Benedikt Böhm +# @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 '{}' + +} -- cgit v1.2.3-18-g5258