Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Tue, 27 Sep 2022 20:28:57
Message-Id: 1664310477.d9c52be803d9b4be5776876d626dab183163822e.mgorny@gentoo
1 commit: d9c52be803d9b4be5776876d626dab183163822e
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 24 13:54:22 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 27 20:27:57 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9c52be8
7
8 unpacker.eclass: Fix unpack_7z to respect the exit status
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 eclass/unpacker.eclass | 5 ++++-
13 1 file changed, 4 insertions(+), 1 deletion(-)
14
15 diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass
16 index c26523a419df..1f2f09e33ad6 100644
17 --- a/eclass/unpacker.eclass
18 +++ b/eclass/unpacker.eclass
19 @@ -344,8 +344,11 @@ unpack_7z() {
20
21 local p7z=$(find_unpackable_file "$1")
22 unpack_banner "${p7z}"
23 - local output="$(7z x -y "${p7z}")"
24
25 + # warning: putting local and command substitution in a single call
26 + # discards the exit status!
27 + local output
28 + output="$(7z x -y "${p7z}")"
29 if [ $? -ne 0 ]; then
30 echo "${output}" >&2
31 die "unpacking ${p7z} failed (arch=unpack_7z)"