commit:     dbff78a1c6ce9f08b25a7c9978a177cc37f1b1bd
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Jul 18 05:36:28 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jul 22 22:29:35 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=dbff78a1

phase-helpers.sh: hoist the my_output local to the top of unpack()

Presently, all of the variables that are local to the unpack() function
are declared at the top of its body, with the exception of the
'my_output' variable. Hoist it upwards so that it is declared at the
same time as the others. Further, rename the variable to 'output'.

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

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

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 609d763915..a350d073a3 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -322,7 +322,7 @@ use_enable() {
 }
 
 unpack() {
-       local created_symlink suffix_known basename srcdir suffix f -
+       local created_symlink suffix_known basename output srcdir suffix f -
        local -a bzip2_cmd
 
        if (( $# == 0 )); then
@@ -438,9 +438,8 @@ unpack() {
                                __unpack_tar "${bzip2_cmd[@]}"
                                ;;
                        7z)
-                               local my_output
-                               if ! my_output=$(7z x -y "${srcdir}${f}"); then
-                                       printf '%s\n' "${my_output}" >&2
+                               if ! output=$(7z x -y "${srcdir}${f}"); then
+                                       printf '%s\n' "${output}" >&2
                                        false
                                fi
                                ;;

Reply via email to