Skip to content

Commit

Permalink
setdevenv.sh: do not use unbound variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 11, 2023
1 parent f3bc13d commit e41f6fc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/setdevenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,30 @@ if [[ ! ${PATH} =~ $CUR_DIR/apps ]]; then
fi

if [[ "$(uname -s)" == "Darwin" ]]; then
if [[ ! "${DYLD_LIBRARY_PATH}" =~ $CUR_DIR ]]; then
export DYLD_LIBRARY_PATH="$CUR_DIR:$DYLD_LIBRARY_PATH"
if [[ ! "${DYLD_LIBRARY_PATH:-}" =~ $CUR_DIR ]]; then
export DYLD_LIBRARY_PATH="$CUR_DIR:${DYLD_LIBRARY_PATH:-}"
echo "Setting DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
fi
else
if [[ ! "${LD_LIBRARY_PATH}" =~ $CUR_DIR ]]; then
export LD_LIBRARY_PATH="$CUR_DIR:$LD_LIBRARY_PATH"
if [[ ! "${LD_LIBRARY_PATH:-}" =~ $CUR_DIR ]]; then
export LD_LIBRARY_PATH="$CUR_DIR:${LD_LIBRARY_PATH:-}"
echo "Setting LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
fi
fi

if [[ ! ${GDAL_DRIVER_PATH} =~ $CUR_DIR/gdalplugins ]]; then
if [[ ! ${GDAL_DRIVER_PATH:-} =~ $CUR_DIR/gdalplugins ]]; then
export GDAL_DRIVER_PATH="$CUR_DIR/gdalplugins"
echo "Setting GDAL_DRIVER_PATH=$GDAL_DRIVER_PATH"
fi

if [[ ! "${GDAL_DATA}" =~ $GDAL_ROOT/data ]]; then
if [[ ! "${GDAL_DATA:-}" =~ $GDAL_ROOT/data ]]; then
export GDAL_DATA="$GDAL_ROOT/data"
echo "Setting GDAL_DATA=$GDAL_DATA"
fi

GDAL_PYTHONPATH="$CUR_DIR/swig/python"
if [[ ! "${PYTHONPATH}" =~ $GDAL_PYTHONPATH ]]; then
export PYTHONPATH="$GDAL_PYTHONPATH:$PYTHONPATH"
if [[ ! "${PYTHONPATH:-}" =~ $GDAL_PYTHONPATH ]]; then
export PYTHONPATH="$GDAL_PYTHONPATH:${PYTHONPATH:-}"
echo "Setting PYTHONPATH=$PYTHONPATH"
fi
unset GDAL_PYTHONPATH

0 comments on commit e41f6fc

Please sign in to comment.