eclass/vcs-clean: Sync with gentoo

It's from gentoo commit 649d76b85a8dfd316c6416c0bb44b9ea4e16f11a.
This commit is contained in:
Krzesimir Nowak 2021-12-21 10:57:55 +01:00
parent f34c6b178e
commit d410c427d4

View File

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation # Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# @ECLASS: vcs-clean.eclass # @ECLASS: vcs-clean.eclass
@ -6,8 +6,17 @@
# base-system@gentoo.org # base-system@gentoo.org
# @AUTHOR: # @AUTHOR:
# Benedikt Böhm <hollow@gentoo.org> # Benedikt Böhm <hollow@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7
# @BLURB: helper functions to remove VCS directories # @BLURB: helper functions to remove VCS directories
case ${EAPI:-0} in
[567]) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_VCS_CLEAN_ECLASS} ]] ; then
_VCS_CLEAN_ECLASS=1
# @FUNCTION: ecvs_clean # @FUNCTION: ecvs_clean
# @USAGE: [list of dirs] # @USAGE: [list of dirs]
# @DESCRIPTION: # @DESCRIPTION:
@ -38,3 +47,5 @@ egit_clean() {
[[ $# -eq 0 ]] && set -- . [[ $# -eq 0 ]] && set -- .
find "$@" -type d -name '.git*' -prune -exec rm -rf '{}' + find "$@" -type d -name '.git*' -prune -exec rm -rf '{}' +
} }
fi