Skip to content

Commit 42c1d25

Browse files
committed
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 <[email protected]>
1 parent c45aef3 commit 42c1d25

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jenkins-init-scripts/lf-env.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ lf-activate-venv () {
266266

267267
# First, try to install with enhanced options
268268
echo "${FUNCNAME[0]}(): INFO: Attempting to install with network-safe options..."
269-
if ! "$lf_venv/bin/python3" -m pip install "$pip_opts" \
269+
# shellcheck disable=SC2086
270+
if ! "$lf_venv/bin/python3" -m pip install $pip_opts \
270271
pip 'setuptools<66' virtualenv; then
271272

272273
echo "${FUNCNAME[0]}(): WARNING: Initial install failed, trying fallback options..."
@@ -315,7 +316,8 @@ lf-activate-venv () {
315316
echo "${FUNCNAME[0]}(): INFO: Installing additional packages: $pkg_list"
316317
# $pkg_list is expected to be unquoted
317318
# shellcheck disable=SC2086
318-
if ! "$lf_venv/bin/python3" -m pip install "$pip_opts" \
319+
# shellcheck disable=SC2086
320+
if ! "$lf_venv/bin/python3" -m pip install $pip_opts \
319321
--upgrade-strategy eager $pkg_list; then
320322
lf-echo-stderr "${FUNCNAME[0]}(): ERROR: Failed to install packages: $pkg_list"
321323
return 1

0 commit comments

Comments
 (0)