Browse Source

autotest: cope with symlinks in vehicle path

master
Andrew Tridgell 10 years ago
parent
commit
730b5d228e
  1. 15
      Tools/autotest/sim_vehicle.sh

15
Tools/autotest/sim_vehicle.sh

@ -188,7 +188,12 @@ SIMOUT_PORT="127.0.0.1:"$((5501+10*$INSTANCE))
FG_PORT="127.0.0.1:"$((5503+10*$INSTANCE)) FG_PORT="127.0.0.1:"$((5503+10*$INSTANCE))
[ -z "$VEHICLE" ] && { [ -z "$VEHICLE" ] && {
VEHICLE=$(basename $PWD) CDIR="$PWD"
rpath=$(which realpath)
[ -n "rpath" ] && {
CDIR=$(realpath $CDIR)
}
VEHICLE=$(basename $CDIR)
} }
[ -z "$FRAME" -a "$VEHICLE" = "APMrover2" ] && { [ -z "$FRAME" -a "$VEHICLE" = "APMrover2" ] && {
@ -287,8 +292,12 @@ autotest="../Tools/autotest"
# the location of the sim_vehicle.sh script to find the path # the location of the sim_vehicle.sh script to find the path
autotest=$(dirname $(readlink -e $0)) autotest=$(dirname $(readlink -e $0))
} }
pushd $autotest/../../$VEHICLE || { VEHICLEDIR="$autotest/../../$VEHICLE"
echo "Failed to change to vehicle directory for $VEHICLE" [ -d "$VEHICLEDIR" ] || {
VEHICLEDIR=$(dirname $(readlink -e $VEHICLEDIR))
}
pushd $VEHICLEDIR || {
echo "Failed to change to vehicle directory for $VEHICLEDIR"
usage usage
exit 1 exit 1
} }

Loading…
Cancel
Save