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 }