From eab675906804637b209920c20dabfa0af86df8fd Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 23 Mar 2026 07:35:18 +0000 Subject: [PATCH] eclass/rpm: Sync with Gentoo It's from Gentoo commit 26b30e180a4b2583452508d79ebb35d0e97fc696. Signed-off-by: Flatcar Buildbot --- .../portage-stable/eclass/rpm.eclass | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/sdk_container/src/third_party/portage-stable/eclass/rpm.eclass b/sdk_container/src/third_party/portage-stable/eclass/rpm.eclass index e00332e55c..3b7f9e6435 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/rpm.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/rpm.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2025 Gentoo Authors +# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: rpm.eclass @@ -8,7 +8,7 @@ # @BLURB: convenience class for extracting RPMs case ${EAPI} in - 7|8) ;; + 7|8) inherit eapi9-pipestatus ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -17,7 +17,12 @@ _RPM_ECLASS=1 inherit estack -BDEPEND="app-arch/rpm2targz" +BDEPEND=" + || ( + app-arch/rpm2targz + >=app-arch/rpm-4.19.0 + ) +" # @FUNCTION: rpm_unpack # @USAGE: @@ -37,8 +42,16 @@ rpm_unpack() { else a="${DISTDIR}/${a}" fi - rpm2tar -O "${a}" | tar xf - - assert "failure unpacking ${a}" + + if command -v rpm2tar >/dev/null; then + local extracttool=(rpm2tar -O) + else + # app-arch/rpm fallback + local extracttool=(rpm2archive -n) + fi + + "${extracttool[@]}" "${a}" | tar xf - + pipestatus || die "failure unpacking ${a}" done }