1 |
commit: 9e892293b5c2517fa7d25c07d351f192ace0d1f0 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jun 20 21:15:55 2021 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jun 20 21:15:55 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e892293 |
7 |
|
8 |
webapp.eclass: [QA] add EAPI guard |
9 |
|
10 |
* Declare supported EAPIs as: [QA] 5, 6, 7 |
11 |
* Add guards to die on unsupported/untested EAPIs |
12 |
* Add inherit guards to prevent multiple sourcing |
13 |
|
14 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
15 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
16 |
|
17 |
eclass/webapp.eclass | 15 +++++++++++++-- |
18 |
1 file changed, 13 insertions(+), 2 deletions(-) |
19 |
|
20 |
diff --git a/eclass/webapp.eclass b/eclass/webapp.eclass |
21 |
index 6907ef1c321..5ef7dbce03c 100644 |
22 |
--- a/eclass/webapp.eclass |
23 |
+++ b/eclass/webapp.eclass |
24 |
@@ -4,11 +4,22 @@ |
25 |
# @ECLASS: webapp.eclass |
26 |
# @MAINTAINER: |
27 |
# web-apps@g.o |
28 |
+# @SUPPORTED_EAPIS: 5 6 7 |
29 |
# @BLURB: functions for installing applications to run under a web server |
30 |
# @DESCRIPTION: |
31 |
# The webapp eclass contains functions to handle web applications with |
32 |
# webapp-config. Part of the implementation of GLEP #11 |
33 |
|
34 |
+case ${EAPI:-0} in |
35 |
+ [567]) ;; |
36 |
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; |
37 |
+esac |
38 |
+ |
39 |
+EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm |
40 |
+ |
41 |
+if [[ -z ${_WEBAPP_ECLASS} ]]; then |
42 |
+_WEBAPP_ECLASS=1 |
43 |
+ |
44 |
# @ECLASS-VARIABLE: WEBAPP_DEPEND |
45 |
# @DESCRIPTION: |
46 |
# An ebuild should use WEBAPP_DEPEND if a custom DEPEND needs to be built, most |
47 |
@@ -35,8 +46,6 @@ if [[ "${WEBAPP_OPTIONAL}" != "yes" ]]; then |
48 |
RDEPEND="${DEPEND}" |
49 |
fi |
50 |
|
51 |
-EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm |
52 |
- |
53 |
INSTALL_DIR="/${PN}" |
54 |
IS_UPGRADE=0 |
55 |
IS_REPLACE=0 |
56 |
@@ -577,3 +586,5 @@ webapp_pkg_prerm() { |
57 |
echo |
58 |
fi |
59 |
} |
60 |
+ |
61 |
+fi |