Skip to content

Commit 7158045

Browse files
avenstewartpeterbarker
authored andcommitted
Tools: Fixed escaping for ArduPilot tools prereq PATH exports
1 parent ff127c8 commit 7158045

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Tools/environment_install/install-prereqs-ubuntu.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ elif [ ${RELEASE_CODENAME} == 'bookworm' ]; then
308308
elif [ ${RELEASE_CODENAME} == 'lunar' ]; then
309309
SITL_PKGS+=" libpython3-stdlib" # for argparse
310310
elif [ ${RELEASE_CODENAME} != 'mantic' ] &&
311-
[ ${RELEASE_CODENAME} != 'noble' ] &&
311+
[ ${RELEASE_CODENAME} != 'noble' ] &&
312312
[ ${RELEASE_CODENAME} != 'oracular' ] &&
313313
[ ${RELEASE_CODENAME} != 'plucky' ] &&
314314
true; then
@@ -516,30 +516,30 @@ if [[ $DO_AP_STM_ENV -eq 1 ]]; then
516516
exportline="export PATH=$OPT/$ARM_ROOT/bin:\$PATH";
517517
grep -Fxq "$exportline" ~/$SHELL_LOGIN 2>/dev/null || {
518518
if maybe_prompt_user "Add $OPT/$ARM_ROOT/bin to your PATH [N/y]?" ; then
519-
echo $exportline >> ~/$SHELL_LOGIN
520-
eval $exportline
519+
echo "$exportline" >> ~/$SHELL_LOGIN
520+
eval "$exportline"
521521
else
522522
echo "Skipping adding $OPT/$ARM_ROOT/bin to PATH."
523523
fi
524524
}
525525
fi
526526

527-
exportline2="export PATH=$ARDUPILOT_ROOT/$ARDUPILOT_TOOLS:\$PATH";
527+
exportline2="export PATH=\"$ARDUPILOT_ROOT/$ARDUPILOT_TOOLS:\"\$PATH";
528528
grep -Fxq "$exportline2" ~/$SHELL_LOGIN 2>/dev/null || {
529529
if maybe_prompt_user "Add $ARDUPILOT_ROOT/$ARDUPILOT_TOOLS to your PATH [N/y]?" ; then
530-
echo $exportline2 >> ~/$SHELL_LOGIN
531-
eval $exportline2
530+
echo "$exportline2" >> ~/$SHELL_LOGIN
531+
eval "$exportline2"
532532
else
533533
echo "Skipping adding $ARDUPILOT_ROOT/$ARDUPILOT_TOOLS to PATH."
534534
fi
535535
}
536536

537537
if [[ $SKIP_AP_COMPLETION_ENV -ne 1 ]]; then
538-
exportline3="source $ARDUPILOT_ROOT/Tools/completion/completion.bash";
538+
exportline3="source \"$ARDUPILOT_ROOT/Tools/completion/completion.bash\"";
539539
grep -Fxq "$exportline3" ~/$SHELL_LOGIN 2>/dev/null || {
540540
if maybe_prompt_user "Add ArduPilot Bash Completion to your bash shell [N/y]?" ; then
541-
echo $exportline3 >> ~/.bashrc
542-
eval $exportline3
541+
echo "$exportline3" >> ~/.bashrc
542+
eval "$exportline3"
543543
else
544544
echo "Skipping adding ArduPilot Bash Completion."
545545
fi
@@ -549,8 +549,8 @@ fi
549549
exportline4="export PATH=/usr/lib/ccache:\$PATH";
550550
grep -Fxq "$exportline4" ~/$SHELL_LOGIN 2>/dev/null || {
551551
if maybe_prompt_user "Append CCache to your PATH [N/y]?" ; then
552-
echo $exportline4 >> ~/$SHELL_LOGIN
553-
eval $exportline4
552+
echo "$exportline4" >> ~/$SHELL_LOGIN
553+
eval "$exportline4"
554554
else
555555
echo "Skipping appending CCache to PATH."
556556
fi
@@ -560,7 +560,7 @@ echo "Done!"
560560
if [[ $SKIP_AP_GIT_CHECK -ne 1 ]]; then
561561
if [ -d ".git" ]; then
562562
heading "Update git submodules"
563-
cd $ARDUPILOT_ROOT
563+
cd "$ARDUPILOT_ROOT"
564564
git submodule update --init --recursive
565565
echo "Done!"
566566
fi

0 commit comments

Comments
 (0)