Tools: install-prereqs-ubuntu: fix exporting PATH

Since we escape $PATH, we can't just try to export that way. Since PATH
is unset if we do this, we end up with things like :

./Tools/scripts/install-prereqs-ubuntu.sh: line 101: apt-cache: command
not found
This commit is contained in:
Lucas De Marchi 2016-04-18 23:33:24 -03:00
parent 0fae368635
commit b8cb88092f

View File

@ -82,7 +82,7 @@ exportline="export PATH=$OPT/$ARM_ROOT/bin:\$PATH";
grep -Fxq "$exportline" ~/.profile 2>/dev/null || { grep -Fxq "$exportline" ~/.profile 2>/dev/null || {
if maybe_prompt_user "Add $OPT/$ARM_ROOT/bin to your PATH [Y/n]?" ; then if maybe_prompt_user "Add $OPT/$ARM_ROOT/bin to your PATH [Y/n]?" ; then
echo $exportline >> ~/.profile echo $exportline >> ~/.profile
$exportline eval $exportline
else else
echo "Skipping adding $OPT/$ARM_ROOT/bin to PATH." echo "Skipping adding $OPT/$ARM_ROOT/bin to PATH."
fi fi
@ -92,7 +92,7 @@ exportline2="export PATH=$ARDUPILOT_ROOT/$ARDUPILOT_TOOLS:\$PATH";
grep -Fxq "$exportline2" ~/.profile 2>/dev/null || { grep -Fxq "$exportline2" ~/.profile 2>/dev/null || {
if maybe_prompt_user "Add $ARDUPILOT_ROOT/$ARDUPILOT_TOOLS to your PATH [Y/n]?" ; then if maybe_prompt_user "Add $ARDUPILOT_ROOT/$ARDUPILOT_TOOLS to your PATH [Y/n]?" ; then
echo $exportline2 >> ~/.profile echo $exportline2 >> ~/.profile
$exportline2 eval $exportline2
else else
echo "Skipping adding $ARDUPILOT_ROOT/$ARDUPILOT_TOOLS to PATH." echo "Skipping adding $ARDUPILOT_ROOT/$ARDUPILOT_TOOLS to PATH."
fi fi