@@ -33,6 +33,7 @@ usage()
3333 echo " Bootstrap ReFrame by pulling all its dependencies"
3434 echo " -P EXEC Use EXEC as Python interpreter"
3535 echo " -h Print this help message and exit"
36+ echo " --ignore-errors Ignore installation errors"
3637 echo " --pip-opts Pass additional options to pip."
3738 echo " +docs Build also the documentation"
3839 echo " +pygelf Install also the pygelf Python package"
@@ -43,17 +44,22 @@ while getopts "hP:-:" opt; do
4344 case $opt in
4445 " P" ) python=$OPTARG ;;
4546 " h" ) usage && exit 0 ;;
46- " -" )
47- case " ${OPTARG} " in
47+ " -" )
48+ case " ${OPTARG} " in
49+ " ignore-errors" ) ignore_errors=1 ;;
4850 pip-opts)
49- PIPOPTS=" ${! OPTIND} " ; OPTIND=$(( $OPTIND + 1 )) ;;
50- pip-opts=* )
51+ PIPOPTS=" ${! OPTIND} " ; OPTIND=$(( $OPTIND + 1 )) ;;
52+ pip-opts=* )
5153 PIPOPTS=${OPTARG#* =} ;;
5254 esac ;;
5355 " ?" ) usage && exit 0 ;;
5456 esac
5557done
5658
59+ if [ -z $ignore_errors ]; then
60+ set -e
61+ fi
62+
5763shift $(( OPTIND - 1 ))
5864if [ -z $python ]; then
5965 python=python3
8288export PIP_USER=0
8389
8490# Check if ensurepip is installed
85- $python -m ensurepip --version & > /dev/null
86- epip=$?
87-
88- export PATH=$( pwd) /external/usr/bin:$PATH
89-
90- # Install pip for Python 3
91- if [ $epip -eq 0 ]; then
91+ if $python -m ensurepip --version & > /dev/null; then
92+ # Install pip for Python 3
9293 CMD $python -m ensurepip --root $( pwd) /external/ --default-pip
9394fi
9495
96+ export PATH=$( pwd) /external/usr/bin:$PATH
97+
9598# ensurepip installs pip in `external/usr/` whereas the `--root` option installs
9699# everything under `external/`. That's why we include both in the PYTHONPATH
97100
0 commit comments