From: Andrew Schoen Date: Tue, 10 Nov 2015 15:21:37 +0000 (-0600) Subject: always update the pip cache before installing packages X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ac48c2071bd6d41de7ab9c8e3cfdaf4abd711e55;p=ceph-build.git always update the pip cache before installing packages We do this to get around a bug in the previous code that would never go out to look for new packages if something in the cache satisfied the requirements. Specifically, we wanted chacractl==0.0.5 installed, but because 0.0.4 exists in the cache and satisified the requirement of >=0.0.4 the cache was never updated to include 0.0.5. Signed-off-by: Andrew Schoen --- diff --git a/ceph-build-next/build/setup b/ceph-build-next/build/setup index 292cc13e..faa83f4a 100644 --- a/ceph-build-next/build/setup +++ b/ceph-build-next/build/setup @@ -76,12 +76,10 @@ mkdir -p $PIP_SDIST_INDEX CHACRACTL_VERSION="chacractl>=0.0.4" -# Install the package by trying with the cache first, otherwise doing a download only, and then -# trying to install from the cache again. -if ! $VENV/pip install --upgrade --find-links="file://$PIP_SDIST_INDEX" --no-index $CHACRACTL_VERSION; then - $VENV/pip install --upgrade --exists-action=i --download-directory="$PIP_SDIST_INDEX" $CHACRACTL_VERSION - $VENV/pip install --upgrade --find-links="file://$PIP_SDIST_INDEX" --no-index $CHACRACTL_VERSION -fi +# download packages to the local pip cache +$VENV/pip install --upgrade --exists-action=i --download="$PIP_SDIST_INDEX" $CHACRACTL_VERSION +# install packages from the local pip cache, ignoring pypi +$VENV/pip install --upgrade --exists-action=i --find-links="file://$PIP_SDIST_INDEX" --no-index $CHACRACTL_VERSION # create the .chacractl config file cat > $HOME/.chacractl << EOF diff --git a/ceph-deploy/build/setup b/ceph-deploy/build/setup index 06f1be77..59a5c948 100644 --- a/ceph-deploy/build/setup +++ b/ceph-deploy/build/setup @@ -19,7 +19,7 @@ fi # Create the virtualenv virtualenv $WORKSPACE/venv -source $WORKSPACE/venv/bin/activate +VENV="$WORKSPACE/venv/bin" # Define and ensure the PIP cache PIP_SDIST_INDEX="$HOME/.cache/pip" @@ -27,12 +27,10 @@ mkdir -p $PIP_SDIST_INDEX CHACRACTL_VERSION="chacractl>=0.0.4" -# Install the package by trying with the cache first, otherwise doing a download only, and then -# trying to install from the cache again. -if ! pip install --upgrade --find-links="file://$PIP_SDIST_INDEX" --no-index $CHACRACTL_VERSION; then - pip install --upgrade --exists-action=i --download-directory="$PIP_SDIST_INDEX" $CHACRACTL_VERSION - pip install --upgrade --find-links="file://$PIP_SDIST_INDEX" --no-index $CHACRACTL_VERSION -fi +# download packages to the local pip cache +$VENV/pip install --upgrade --exists-action=i --download="$PIP_SDIST_INDEX" $CHACRACTL_VERSION +# install packages from the local pip cache, ignoring pypi +$VENV/pip install --upgrade --exists-action=i --find-links="file://$PIP_SDIST_INDEX" --no-index $CHACRACTL_VERSION # create the .chacractl config file cat > $HOME/.chacractl << EOF diff --git a/ceph-release-rpm/build/build b/ceph-release-rpm/build/build index 468fee57..ccf192df 100644 --- a/ceph-release-rpm/build/build +++ b/ceph-release-rpm/build/build @@ -22,12 +22,10 @@ mkdir -p $PIP_SDIST_INDEX CHACRACTL_VERSION="chacractl>=0.0.4" -# Install the package by trying with the cache first, otherwise doing a download only, and then -# trying to install from the cache again. -if ! $VENV/pip install --upgrade --find-links="file://$PIP_SDIST_INDEX" --no-index $CHACRACTL_VERSION; then - $VENV/pip install --upgrade --exists-action=i --download-directory="$PIP_SDIST_INDEX" $CHACRACTL_VERSION - $VENV/pip install --upgrade --find-links="file://$PIP_SDIST_INDEX" --no-index $CHACRACTL_VERSION -fi +# download packages to the local pip cache +$VENV/pip install --upgrade --exists-action=i --download="$PIP_SDIST_INDEX" $CHACRACTL_VERSION +# install packages from the local pip cache, ignoring pypi +$VENV/pip install --upgrade --exists-action=i --find-links="file://$PIP_SDIST_INDEX" --no-index $CHACRACTL_VERSION # create the .chacractl config file cat > $HOME/.chacractl << EOF