Mailing List Archive

[PATCH] rpm.eclass: Support EAPI 8, some cleanup
Closes: https://bugs.gentoo.org/655256
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
eclass/rpm.eclass | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/eclass/rpm.eclass b/eclass/rpm.eclass
index 351d7974877e..1757e2cba5f2 100644
--- a/eclass/rpm.eclass
+++ b/eclass/rpm.eclass
@@ -4,11 +4,14 @@
# @ECLASS: rpm.eclass
# @MAINTAINER:
# base-system@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: convenience class for extracting RPMs

-case ${EAPI:-0} in
- [567]) inherit eutils ;;
+case ${EAPI} in
+ # eutils not actually needed, only inherited in case ebuilds rely on it
+ 5|6) inherit epatch eutils ;;
+ 7) inherit eutils ;;
+ 8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

@@ -19,8 +22,8 @@ _RPM_ECLASS=1

inherit estack

-case "${EAPI:-0}" in
- [0-6]) DEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
+case ${EAPI} in
+ 5|6) DEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
*) BDEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
esac

@@ -34,15 +37,16 @@ rpm_unpack() {
for a in "$@" ; do
echo ">>> Unpacking ${a} to ${PWD}"
if [[ ${a} == ./* ]] ; then
- : nothing to do -- path is local
- elif [[ ${a} == ${DISTDIR}/* ]] ; then
+ : # nothing to do -- path is local
+ elif [[ ${a} == "${DISTDIR}"/* ]] ; then
ewarn 'QA: do not use ${DISTDIR} with rpm_unpack -- it is added for you'
elif [[ ${a} == /* ]] ; then
ewarn 'QA: do not use full paths with rpm_unpack -- use ./ paths instead'
else
a="${DISTDIR}/${a}"
fi
- rpm2tar -O "${a}" | tar xf - || die "failure unpacking ${a}"
+ rpm2tar -O "${a}" | tar xf -
+ assert "failure unpacking ${a}"
done
}

@@ -64,9 +68,9 @@ srcrpm_unpack() {

# unpack everything
local a
- for a in *.tar.{gz,bz2,xz} *.t{gz,bz2,xz,pxz} *.zip *.ZIP ; do
+ for a in *.tar.{gz,bz2,xz} *.t{gz,bz2,xz} *.zip *.ZIP ; do
unpack "./${a}"
- rm -f "${a}"
+ rm -f "${a}" || die
done

eshopts_pop
@@ -90,11 +94,15 @@ rpm_src_unpack() {

# @FUNCTION: rpm_spec_epatch
# @USAGE: [spec]
+# @DEPRECATED: none
# @DESCRIPTION:
# Read the specified spec (defaults to ${PN}.spec) and attempt to apply
# all the patches listed in it. If the spec does funky things like moving
# files around, well this won't handle that.
rpm_spec_epatch() {
+ # no epatch in EAPI 7 and later
+ [[ ${EAPI} == [56] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}"
+
local p spec=$1
local dir

--
2.32.0