summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2021-06-23 20:36:57 +0200
committerUlrich Müller <ulm@gentoo.org>2021-06-26 19:05:57 +0200
commit3b4d86d292e43516a6244bb6b7897ac3a28da180 (patch)
treeafa31ad213771fc12255742f7f468b741444c558 /eclass/rpm.eclass
parentapp-emacs/puppet-mode: remove unused patch (diff)
downloadgentoo-3b4d86d292e43516a6244bb6b7897ac3a28da180.tar.gz
gentoo-3b4d86d292e43516a6244bb6b7897ac3a28da180.tar.bz2
gentoo-3b4d86d292e43516a6244bb6b7897ac3a28da180.zip
rpm.eclass: Support EAPI 8, some cleanup
Closes: https://bugs.gentoo.org/655256 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'eclass/rpm.eclass')
-rw-r--r--eclass/rpm.eclass33
1 files changed, 20 insertions, 13 deletions
diff --git a/eclass/rpm.eclass b/eclass/rpm.eclass
index 351d7974877..77db8e80879 100644
--- a/eclass/rpm.eclass
+++ b/eclass/rpm.eclass
@@ -4,11 +4,13 @@
# @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
+ 5|6) inherit epatch eutils ;; # eutils for eqawarn
+ 7) inherit eutils ;; # not needed, but ebuilds may still rely on it
+ 8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -19,9 +21,9 @@ _RPM_ECLASS=1
inherit estack
-case "${EAPI:-0}" in
- [0-6]) DEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
- *) BDEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
+case ${EAPI} in
+ 5|6) DEPEND="app-arch/rpm2targz" ;;
+ *) BDEPEND="app-arch/rpm2targz" ;;
esac
# @FUNCTION: rpm_unpack
@@ -34,15 +36,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
- ewarn 'QA: do not use ${DISTDIR} with rpm_unpack -- it is added for you'
+ : # nothing to do -- path is local
+ elif [[ ${a} == "${DISTDIR}"/* ]] ; then
+ eqawarn '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'
+ eqawarn '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 +67,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 +93,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