commit:     3796ccdf04122cbd1a03e023dff2a4a684e42bc6
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Jul 27 20:22:30 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 30 08:14:21 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3796ccdf

phase-helpers.sh: check the exit status of 7z directly

There's no need to check $? specifically. While at it, use printf
instead of echo.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/phase-helpers.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3378d8971a..128c00a227 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -426,9 +426,8 @@ unpack() {
                                ;;
                        7z)
                                local my_output
-                               my_output="$(7z x -y "${srcdir}${f}")"
-                               if [[ $? -ne 0 ]]; then
-                                       echo "${my_output}" >&2
+                               if ! my_output=$(7z x -y "${srcdir}${f}"); then
+                                       printf '%s\n' "${my_output}" >&2
                                        die "${myfail}"
                                fi
                                ;;

Reply via email to