Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 1ea25ea1 authored by hhakim's avatar hhakim
Browse files

Avoid to exit in matlab postinstall script.

It could block another postinstall script to be executed after.
parent 70f0ac5a
Branches
Tags 2.2-rc3
No related merge requests found
Pipeline #833823 skipped
......@@ -8,10 +8,13 @@ function dirname_noerr {
MATLAB_ROOT=$(dirname_noerr $(dirname_noerr $(which matlab 2>/dev/null)))
[[ ! -d "${MATLAB_ROOT}" ]] && MATLAB_ROOT=$(dirname_noerr $(dirname_noerr $(find /usr/local -maxdepth 10 -type f -name "matlab" | tail -n 1)))
[[ ! -d "${MATLAB_ROOT}" ]] && MATLAB_ROOT=$(dirname_noerr $(dirname_noerr $(find /opt/ -maxdepth 10 -type f -name "matlab" | tail -n 1)))
[[ ! "$?" = 0 || ! -d "${MATLAB_ROOT}" ]] && echo "Can't find Matlab root dir. Add MATLAB_ROOT/bin to the PATH environment variable (of root user)." >&2 && exit 1
STARTUP_DIR="${MATLAB_ROOT}/toolbox/local/"
STARTUP_FILE=${STARTUP_DIR}/startup.m
[[ -r "$STARTUP_FILE" ]] && grep -i -v faust "$STARTUP_FILE" > "$STARTUP_FILE"
FAUST_MATLAB_WRAPPER_PATH="@CMAKE_INSTALL_MATLAB_PREFIX@"
echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> "$STARTUP_FILE"
if [[ ! "$?" = 0 || ! -d "${MATLAB_ROOT}" ]]
then
echo "Can't find Matlab root dir. Add MATLAB_ROOT/bin to the PATH environment variable (of root user)." >&2
else
STARTUP_DIR="${MATLAB_ROOT}/toolbox/local/"
STARTUP_FILE=${STARTUP_DIR}/startup.m
[[ -r "$STARTUP_FILE" ]] && grep -i -v faust "$STARTUP_FILE" > "$STARTUP_FILE"
FAUST_MATLAB_WRAPPER_PATH="@CMAKE_INSTALL_MATLAB_PREFIX@"
echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> "$STARTUP_FILE"
fi
#!/bin/bash
MATLAB_ROOT=$(find /Applications/ -iname "MATLAB*" -maxdepth 1 | tail -n 1)
[[ ! "$?" = 0 || ! -d "${MATLAB_ROOT}" ]] && echo "Can't find Matlab root dir. Add MATLAB_ROOT/bin to the PATH environment variable (of admin. user)." >&2 && exit 1
STARTUP_DIR="${MATLAB_ROOT}/toolbox/local/"
STARTUP_FILE=${STARTUP_DIR}/startup.m
[[ -r "$STARTUP_FILE" ]] && grep -i -v faust "$STARTUP_FILE" > "$STARTUP_FILE"
FAUST_MATLAB_WRAPPER_PATH="@CMAKE_INSTALL_MATLAB_PREFIX@"
echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> $STARTUP_FILE
if [[ ! "$?" = 0 || ! -d "${MATLAB_ROOT}" ]]
then
echo "Can't find Matlab root dir. Add MATLAB_ROOT/bin to the PATH environment variable (of admin. user)." >&2
else
STARTUP_DIR="${MATLAB_ROOT}/toolbox/local/"
STARTUP_FILE=${STARTUP_DIR}/startup.m
[[ -r "$STARTUP_FILE" ]] && grep -i -v faust "$STARTUP_FILE" > "$STARTUP_FILE"
FAUST_MATLAB_WRAPPER_PATH="@CMAKE_INSTALL_MATLAB_PREFIX@"
echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> $STARTUP_FILE
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment