diskimage-builder/elements/pypi/extra-data.d/00-mount-pypi-mirror
Robert Collins 1adf3a377e Permit using arbitrary PyPI urls.
The pypi element is cool, but some folk have local network mirrors
which we should permit them to use.

Change-Id: Ie840ad1184e72b0e01966eee0298cfd6511b6c19
2014-02-19 14:05:31 +13:00

15 lines
368 B
Bash
Executable File

#!/bin/bash
set -eu
PYPI_MIRROR_URL=${PYPI_MIRROR_URL:-''}
if [ -n "$PYPI_MIRROR_URL" ]; then
# External mirror URL being used - no need to bind mount anything.
exit 0
fi
MIRROR_SOURCE=~/.cache/image-create/pypi/mirror/
MIRROR_TARGET=$TMP_MOUNT_PATH/tmp/pypi
sudo mkdir -p $MIRROR_SOURCE $MIRROR_TARGET
sudo mount --bind $MIRROR_SOURCE $TMP_MOUNT_PATH/tmp/pypi