commit: d9c52be803d9b4be5776876d626dab183163822e
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 24 13:54:22 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Sep 27 20:27:57 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9c52be8
unpacker.eclass: Fix unpack_7z to respect the exit status
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/unpacker.eclass | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass
index c26523a419df..1f2f09e33ad6 100644
--- a/eclass/unpacker.eclass
+++ b/eclass/unpacker.eclass
@@ -344,8 +344,11 @@ unpack_7z() {
local p7z=$(find_unpackable_file "$1")
unpack_banner "${p7z}"
- local output="$(7z x -y "${p7z}")"
+ # warning: putting local and command substitution in a single call
+ # discards the exit status!
+ local output
+ output="$(7z x -y "${p7z}")"
if [ $? -ne 0 ]; then
echo "${output}" >&2
die "unpacking ${p7z} failed (arch=unpack_7z)"