1 |
commit: 649d76b85a8dfd316c6416c0bb44b9ea4e16f11a |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jun 20 21:15:43 2021 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jun 20 21:15:43 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=649d76b8 |
7 |
|
8 |
vcs-clean.eclass: [QA] add EAPI guard |
9 |
|
10 |
* Declare suppported EAPIs. |
11 |
* Add EAPI guard to prevent newer/older unsupported EAPIs from using this |
12 |
eclass when they've not been tested/eclass isn't adapted for it. |
13 |
* Add inherit guard as is convention. |
14 |
|
15 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
16 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
17 |
|
18 |
eclass/vcs-clean.eclass | 13 ++++++++++++- |
19 |
1 file changed, 12 insertions(+), 1 deletion(-) |
20 |
|
21 |
diff --git a/eclass/vcs-clean.eclass b/eclass/vcs-clean.eclass |
22 |
index 649a9e3039b..89f6b732187 100644 |
23 |
--- a/eclass/vcs-clean.eclass |
24 |
+++ b/eclass/vcs-clean.eclass |
25 |
@@ -1,4 +1,4 @@ |
26 |
-# Copyright 1999-2018 Gentoo Foundation |
27 |
+# Copyright 1999-2021 Gentoo Authors |
28 |
# Distributed under the terms of the GNU General Public License v2 |
29 |
|
30 |
# @ECLASS: vcs-clean.eclass |
31 |
@@ -6,8 +6,17 @@ |
32 |
# base-system@g.o |
33 |
# @AUTHOR: |
34 |
# Benedikt Böhm <hollow@g.o> |
35 |
+# @SUPPORTED_EAPIS: 5 6 7 |
36 |
# @BLURB: helper functions to remove VCS directories |
37 |
|
38 |
+case ${EAPI:-0} in |
39 |
+ [567]) ;; |
40 |
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; |
41 |
+esac |
42 |
+ |
43 |
+if [[ -z ${_VCS_CLEAN_ECLASS} ]] ; then |
44 |
+_VCS_CLEAN_ECLASS=1 |
45 |
+ |
46 |
# @FUNCTION: ecvs_clean |
47 |
# @USAGE: [list of dirs] |
48 |
# @DESCRIPTION: |
49 |
@@ -38,3 +47,5 @@ egit_clean() { |
50 |
[[ $# -eq 0 ]] && set -- . |
51 |
find "$@" -type d -name '.git*' -prune -exec rm -rf '{}' + |
52 |
} |
53 |
+ |
54 |
+fi |