mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-28 14:01:43 +01:00
eclass/unpacker: Sync with Gentoo
It's from Gentoo commit d33762e29e5a768a25abd7ca895d7b55e6f5951d.
This commit is contained in:
parent
f434e4e6f4
commit
b2d4f93d83
@ -1,4 +1,4 @@
|
|||||||
# Copyright 1999-2024 Gentoo Authors
|
# Copyright 1999-2025 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
# @ECLASS: unpacker.eclass
|
# @ECLASS: unpacker.eclass
|
||||||
@ -375,10 +375,15 @@ unpack_7z() {
|
|||||||
local p7z=$(find_unpackable_file "$1")
|
local p7z=$(find_unpackable_file "$1")
|
||||||
unpack_banner "${p7z}"
|
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
|
# warning: putting local and command substitution in a single call
|
||||||
# discards the exit status!
|
# discards the exit status!
|
||||||
local output
|
local output
|
||||||
output="$(7z x -y "${p7z}")"
|
output="$($cmd7z x -y "${p7z}")"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "${output}" >&2
|
echo "${output}" >&2
|
||||||
die "unpacking ${p7z} failed (arch=unpack_7z)"
|
die "unpacking ${p7z} failed (arch=unpack_7z)"
|
||||||
@ -610,7 +615,13 @@ unpacker_src_uri_depends() {
|
|||||||
*.rar)
|
*.rar)
|
||||||
deps[rar]="app-arch/unrar" ;;
|
deps[rar]="app-arch/unrar" ;;
|
||||||
*.7z)
|
*.7z)
|
||||||
deps[7z]="app-arch/p7zip" ;;
|
deps[7z]="
|
||||||
|
|| (
|
||||||
|
app-arch/7zip
|
||||||
|
app-arch/p7zip
|
||||||
|
)
|
||||||
|
"
|
||||||
|
;;
|
||||||
*.xz)
|
*.xz)
|
||||||
deps[xz]="app-arch/xz-utils" ;;
|
deps[xz]="app-arch/xz-utils" ;;
|
||||||
*.zip)
|
*.zip)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user