eclass/vcs-clean: Sync with Gentoo

It's from Gentoo commit c8af7eb1285a2683460618b71e2e9a14ca6badcd.
This commit is contained in:
Flatcar Buildbot 2024-10-21 07:07:34 +00:00
parent d7e18ba370
commit c744441ead

View File

@ -6,17 +6,13 @@
# base-system@gentoo.org
# @AUTHOR:
# Benedikt Böhm <hollow@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @BLURB: helper functions to remove VCS directories
if [[ -z ${_VCS_CLEAN_ECLASS} ]] ; then
_VCS_CLEAN_ECLASS=1
case ${EAPI} in
5|6)
ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated EAPI ${EAPI}!"
ewarn "${CATEGORY}/${PF}: Support will be removed on 2024-10-08. Please port to newer EAPI."
;;
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@ -27,7 +23,7 @@ esac
# Remove CVS directories and .cvs* files recursively. Useful when a
# source tarball contains internal CVS directories. Defaults to ${PWD}.
ecvs_clean() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
[[ $# -eq 0 ]] && set -- .
find "$@" '(' -type d -name 'CVS' -prune -o -type f -name '.cvs*' ')' \
@ -40,7 +36,7 @@ ecvs_clean() {
# Remove .svn directories recursively. Useful when a source tarball
# contains internal Subversion directories. Defaults to ${PWD}.
esvn_clean() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
[[ $# -eq 0 ]] && set -- .
find "$@" -type d -name '.svn' -prune -exec rm -rf '{}' + || die
@ -52,7 +48,7 @@ esvn_clean() {
# Remove .git* directories recursively. Useful when a source tarball
# contains internal Git directories. Defaults to ${PWD}.
egit_clean() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
[[ $# -eq 0 ]] && set -- .
find "$@" -type d -name '.git*' -prune -exec rm -rf '{}' + || die