]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
always update the pip cache before installing packages 219/head
authorAndrew Schoen <aschoen@redhat.com>
Tue, 10 Nov 2015 15:21:37 +0000 (09:21 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 10 Nov 2015 15:21:37 +0000 (09:21 -0600)
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 <aschoen@redhat.com>
ceph-build-next/build/setup
ceph-deploy/build/setup
ceph-release-rpm/build/build

index 292cc13e7b31f2d809a1725cf03aaa7dcccaf167..faa83f4a2bdb7b60a0952c356a4ba87ed000df2e 100644 (file)
@@ -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
index 06f1be7793989a53367877980d6301eff5c4f538..59a5c9481e1d7c2a92b0c65cfc4b7b4fcf9817a3 100644 (file)
@@ -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
index 468fee5729cb68ffb2404b72d5ca1c7d69121368..ccf192df902028cea38e72fe9171b5f689b5fd42 100644 (file)
@@ -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