commit:     0dbde702f43e075d88332b42c93287b200028691
Author:     NRK <nrk <AT> disroot <DOT> org>
AuthorDate: Fri Mar 14 17:25:16 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 24 06:52:56 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0dbde702

unpacker.eclass: add support for app-arch/7zip

Signed-off-by: NRK <nrk <AT> disroot.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/unpacker.eclass | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass
index 91520a36d16a..2697b8d9d73e 100644
--- a/eclass/unpacker.eclass
+++ b/eclass/unpacker.eclass
@@ -375,10 +375,15 @@ unpack_7z() {
        local p7z=$(find_unpackable_file "$1")
        unpack_banner "${p7z}"
 
+       local cmd7z="7z"
+       if command -v 7zz 1>/dev/null 2>&1; then
+               cmd7z="7zz"
+       fi
+
        # warning: putting local and command substitution in a single call
        # discards the exit status!
        local output
-       output="$(7z x -y "${p7z}")"
+       output="$($cmd7z x -y "${p7z}")"
        if [ $? -ne 0 ]; then
                echo "${output}" >&2
                die "unpacking ${p7z} failed (arch=unpack_7z)"
@@ -610,7 +615,13 @@ unpacker_src_uri_depends() {
                *.rar)
                        deps[rar]="app-arch/unrar" ;;
                *.7z)
-                       deps[7z]="app-arch/p7zip" ;;
+                       deps[7z]="
+                               || (
+                                       app-arch/7zip
+                                       app-arch/p7zip
+                               )
+                       "
+                       ;;
                *.xz)
                        deps[xz]="app-arch/xz-utils" ;;
                *.zip)

Reply via email to