diff --git a/bootstrap.sh b/bootstrap.sh index 5869de656f..f87027d4a1 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -33,6 +33,7 @@ usage() echo "Bootstrap ReFrame by pulling all its dependencies" echo " -P EXEC Use EXEC as Python interpreter" echo " -h Print this help message and exit" + echo " --ignore-errors Ignore installation errors" echo " --pip-opts Pass additional options to pip." echo " +docs Build also the documentation" echo " +pygelf Install also the pygelf Python package" @@ -43,17 +44,22 @@ while getopts "hP:-:" opt; do case $opt in "P") python=$OPTARG ;; "h") usage && exit 0 ;; - "-") - case "${OPTARG}" in + "-") + case "${OPTARG}" in + "ignore-errors") ignore_errors=1 ;; pip-opts) - PIPOPTS="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 )) ;; - pip-opts=*) + PIPOPTS="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 )) ;; + pip-opts=*) PIPOPTS=${OPTARG#*=} ;; esac;; "?") usage && exit 0 ;; esac done +if [ -z $ignore_errors ]; then + set -e +fi + shift $((OPTIND - 1)) if [ -z $python ]; then python=python3 @@ -82,16 +88,13 @@ fi export PIP_USER=0 # Check if ensurepip is installed -$python -m ensurepip --version &> /dev/null -epip=$? - -export PATH=$(pwd)/external/usr/bin:$PATH - -# Install pip for Python 3 -if [ $epip -eq 0 ]; then +if $python -m ensurepip --version &> /dev/null; then + # Install pip for Python 3 CMD $python -m ensurepip --root $(pwd)/external/ --default-pip fi +export PATH=$(pwd)/external/usr/bin:$PATH + # ensurepip installs pip in `external/usr/` whereas the `--root` option installs # everything under `external/`. That's why we include both in the PYTHONPATH