2013-08-09 13:13:15 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
2014-02-19 01:03:56 +00:00
|
|
|
PYPIURL=${PYPI_MIRROR_URL:-'file:///tmp/pypi'}
|
2013-08-09 13:13:15 +00:00
|
|
|
mkdir -p ~/.pip
|
|
|
|
|
|
|
|
if [ -e ~/.pip/pip.conf ]; then
|
|
|
|
mv ~/.pip/pip.conf{,.orig}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -e ~/.pydistutils.cfg ]; then
|
|
|
|
mv ~/.pydistutils.cfg{,.orig}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z $DIB_OFFLINE ]; then
|
|
|
|
ONLINE="extra-index-url = https://pypi.python.org/simple"
|
|
|
|
else
|
|
|
|
ONLINE=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat <<EOF > ~/.pip/pip.conf
|
|
|
|
[global]
|
|
|
|
index-url = $PYPIURL
|
|
|
|
$ONLINE
|
|
|
|
log = $HOME/pip.log
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat <<EOF > ~/.pydistutils.cfg
|
|
|
|
[easy_install]
|
|
|
|
index_url = $PYPIURL
|
|
|
|
EOF
|