Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down