Skip to content

Commit

Permalink
Fix unexpected subshell execution in bootstrap.sh (secure-software-en…
Browse files Browse the repository at this point in the history
…gineering#678)

For `(list)` in bash, `list` is executed in a subshell environment. Variable assignments do not remain in effect after the command completes.

Fix by using `{ list; }`, where `list` is executed in the current shell environment.
  • Loading branch information
szsam authored Nov 7, 2023
1 parent 9eda5e2 commit 02e832d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ if [ ! -z "${DESIRED_BOOST_DIR}" ]; then
else
# New way of installing boost:
# Check whether we have the required boost packages installed
(BOOST_VERSION=$(echo -e '#include <boost/version.hpp>\nBOOST_LIB_VERSION' | gcc -s -x c++ -E - 2>/dev/null| grep "^[^#;]" | tr -d '\"')) || true
{ BOOST_VERSION=$(echo -e '#include <boost/version.hpp>\nBOOST_LIB_VERSION' | gcc -s -x c++ -E - 2>/dev/null| grep "^[^#;]" | tr -d '\"'); } || true

if [ -z "$BOOST_VERSION" ] ;then
if [ -x "$(command -v pacman)" ]; then
Expand Down

0 comments on commit 02e832d

Please sign in to comment.