1 |
commit: 3b4d86d292e43516a6244bb6b7897ac3a28da180 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 23 18:36:57 2021 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 26 17:05:57 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b4d86d2 |
7 |
|
8 |
rpm.eclass: Support EAPI 8, some cleanup |
9 |
|
10 |
Closes: https://bugs.gentoo.org/655256 |
11 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
12 |
|
13 |
eclass/rpm.eclass | 33 ++++++++++++++++++++------------- |
14 |
1 file changed, 20 insertions(+), 13 deletions(-) |
15 |
|
16 |
diff --git a/eclass/rpm.eclass b/eclass/rpm.eclass |
17 |
index 351d7974877..77db8e80879 100644 |
18 |
--- a/eclass/rpm.eclass |
19 |
+++ b/eclass/rpm.eclass |
20 |
@@ -4,11 +4,13 @@ |
21 |
# @ECLASS: rpm.eclass |
22 |
# @MAINTAINER: |
23 |
# base-system@g.o |
24 |
-# @SUPPORTED_EAPIS: 5 6 7 |
25 |
+# @SUPPORTED_EAPIS: 5 6 7 8 |
26 |
# @BLURB: convenience class for extracting RPMs |
27 |
|
28 |
-case ${EAPI:-0} in |
29 |
- [567]) inherit eutils ;; |
30 |
+case ${EAPI} in |
31 |
+ 5|6) inherit epatch eutils ;; # eutils for eqawarn |
32 |
+ 7) inherit eutils ;; # not needed, but ebuilds may still rely on it |
33 |
+ 8) ;; |
34 |
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; |
35 |
esac |
36 |
|
37 |
@@ -19,9 +21,9 @@ _RPM_ECLASS=1 |
38 |
|
39 |
inherit estack |
40 |
|
41 |
-case "${EAPI:-0}" in |
42 |
- [0-6]) DEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;; |
43 |
- *) BDEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;; |
44 |
+case ${EAPI} in |
45 |
+ 5|6) DEPEND="app-arch/rpm2targz" ;; |
46 |
+ *) BDEPEND="app-arch/rpm2targz" ;; |
47 |
esac |
48 |
|
49 |
# @FUNCTION: rpm_unpack |
50 |
@@ -34,15 +36,16 @@ rpm_unpack() { |
51 |
for a in "$@" ; do |
52 |
echo ">>> Unpacking ${a} to ${PWD}" |
53 |
if [[ ${a} == ./* ]] ; then |
54 |
- : nothing to do -- path is local |
55 |
- elif [[ ${a} == ${DISTDIR}/* ]] ; then |
56 |
- ewarn 'QA: do not use ${DISTDIR} with rpm_unpack -- it is added for you' |
57 |
+ : # nothing to do -- path is local |
58 |
+ elif [[ ${a} == "${DISTDIR}"/* ]] ; then |
59 |
+ eqawarn 'do not use ${DISTDIR} with rpm_unpack -- it is added for you' |
60 |
elif [[ ${a} == /* ]] ; then |
61 |
- ewarn 'QA: do not use full paths with rpm_unpack -- use ./ paths instead' |
62 |
+ eqawarn 'do not use full paths with rpm_unpack -- use ./ paths instead' |
63 |
else |
64 |
a="${DISTDIR}/${a}" |
65 |
fi |
66 |
- rpm2tar -O "${a}" | tar xf - || die "failure unpacking ${a}" |
67 |
+ rpm2tar -O "${a}" | tar xf - |
68 |
+ assert "failure unpacking ${a}" |
69 |
done |
70 |
} |
71 |
|
72 |
@@ -64,9 +67,9 @@ srcrpm_unpack() { |
73 |
|
74 |
# unpack everything |
75 |
local a |
76 |
- for a in *.tar.{gz,bz2,xz} *.t{gz,bz2,xz,pxz} *.zip *.ZIP ; do |
77 |
+ for a in *.tar.{gz,bz2,xz} *.t{gz,bz2,xz} *.zip *.ZIP ; do |
78 |
unpack "./${a}" |
79 |
- rm -f "${a}" |
80 |
+ rm -f "${a}" || die |
81 |
done |
82 |
|
83 |
eshopts_pop |
84 |
@@ -90,11 +93,15 @@ rpm_src_unpack() { |
85 |
|
86 |
# @FUNCTION: rpm_spec_epatch |
87 |
# @USAGE: [spec] |
88 |
+# @DEPRECATED: none |
89 |
# @DESCRIPTION: |
90 |
# Read the specified spec (defaults to ${PN}.spec) and attempt to apply |
91 |
# all the patches listed in it. If the spec does funky things like moving |
92 |
# files around, well this won't handle that. |
93 |
rpm_spec_epatch() { |
94 |
+ # no epatch in EAPI 7 and later |
95 |
+ [[ ${EAPI} == [56] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}" |
96 |
+ |
97 |
local p spec=$1 |
98 |
local dir |