commit:     d14d5c76dc748555c6e34a18dc6442d7298a8149
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 20 21:15:58 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Jun 20 21:15:58 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d14d5c76

xemacs-packages.eclass: [QA] add EAPI guard

* Declare supported EAPIs as: EAPI 6, EAPI 7. There are no EAPI 5 consumers in
  tree.
* Add EAPI guard to prevent newer/older unsupported EAPIs from using this
  eclass when they've not been tested/eclass isn't adapted for it.
* Add inherit guard as is convention.

Closes: https://github.com/gentoo/gentoo/pull/21346
Signed-off-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 eclass/xemacs-packages.eclass | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/eclass/xemacs-packages.eclass b/eclass/xemacs-packages.eclass
index 372e4c5301c..99c6b63014c 100644
--- a/eclass/xemacs-packages.eclass
+++ b/eclass/xemacs-packages.eclass
@@ -4,6 +4,7 @@
 # @ECLASS: xemacs-packages.eclass
 # @MAINTAINER:
 # xem...@gentoo.org
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: Eclass to support elisp packages distributed by XEmacs.
 # @DESCRIPTION:
 # This eclass supports ebuilds for packages distributed by XEmacs.
@@ -23,8 +24,16 @@
 # in the experimental repository are auto-generated from XEmacs VCS, so
 # they may not be well-tested.
 
+case ${EAPI:-0} in
+       [67]) ;;
+       *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 EXPORT_FUNCTIONS src_unpack src_install
 
+if [[ -z ${_XEMACS_PACKAGES_ECLASS} ]] ; then
+_XEMACS_PACKAGES_ECLASS=1
+
 RDEPEND="app-editors/xemacs"
 S="${WORKDIR}"
 
@@ -55,6 +64,8 @@ xemacs-packages_src_install() {
        debug-print "install_dir is ${install_dir}"
 
        dodir "${install_dir}"
-       cd "${D}${EPREFIX}${install_dir}" || die
+       cd "${ED}${install_dir}" || die
        unpack ${A}
 }
+
+fi

Reply via email to