From: Anil Belur Date: Tue, 26 Aug 2025 21:29:36 +0000 (+1000) Subject: Fix: Correct pip_opts var expansion in lf-act-venv X-Git-Tag: v0.92.3^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F65%2F73565%2F1;p=releng%2Fglobal-jjb.git Fix: Correct pip_opts var expansion in lf-act-venv Fix shell variable expansion issue where quoted $pip_opts was being treated as a single argument instead of multiple pip options. Use unquoted expansion with shellcheck disable comment to allow proper argument splitting. Change-Id: I91014c585216449587719f58e7e1c73f14be82fd Signed-off-by: Anil Belur --- diff --git a/jenkins-init-scripts/lf-env.sh b/jenkins-init-scripts/lf-env.sh index 319c4ca2..de1c4d5f 100644 --- a/jenkins-init-scripts/lf-env.sh +++ b/jenkins-init-scripts/lf-env.sh @@ -266,7 +266,8 @@ lf-activate-venv () { # First, try to install with enhanced options echo "${FUNCNAME[0]}(): INFO: Attempting to install with network-safe options..." - if ! "$lf_venv/bin/python3" -m pip install "$pip_opts" \ + # shellcheck disable=SC2086 + if ! "$lf_venv/bin/python3" -m pip install $pip_opts \ pip 'setuptools<66' virtualenv; then echo "${FUNCNAME[0]}(): WARNING: Initial install failed, trying fallback options..." @@ -315,7 +316,8 @@ lf-activate-venv () { echo "${FUNCNAME[0]}(): INFO: Installing additional packages: $pkg_list" # $pkg_list is expected to be unquoted # shellcheck disable=SC2086 - if ! "$lf_venv/bin/python3" -m pip install "$pip_opts" \ + # shellcheck disable=SC2086 + if ! "$lf_venv/bin/python3" -m pip install $pip_opts \ --upgrade-strategy eager $pkg_list; then lf-echo-stderr "${FUNCNAME[0]}(): ERROR: Failed to install packages: $pkg_list" return 1