]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps: nuke wheelhouse if it's stale
authorKefu Chai <kchai@redhat.com>
Wed, 16 May 2018 11:41:52 +0000 (19:41 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 4 Oct 2019 09:16:49 +0000 (11:16 +0200)
otherwise, if we update *requirements.txt, and the wheelhouse fails to
offer the newly added dependency, the setup-virtualenv.sh will fail the
build.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit ed0ca70707439f44779ca7093461182d73db1a77)

install-deps.sh
src/tools/setup-virtualenv.sh

index e609755636db13689c65a09e36b49b8dbc895aa2..2b92edaebac8a7188503c972f7a6615edf6b6f3e 100755 (executable)
@@ -329,6 +329,12 @@ find . -name tox.ini | while read ini ; do
     (
         cd $(dirname $ini)
         require=$(ls *requirements.txt 2>/dev/null | sed -e 's/^/-r /')
+        md5=wheelhouse/md5
+        if test "$require"; then
+            if ! test -f $md5 || ! md5sum -c $md5 ; then
+                rm -rf wheelhouse
+            fi
+        fi
         if test "$require" && ! test -d wheelhouse ; then
             for interpreter in python2.7 python3 ; do
                 type $interpreter > /dev/null 2>&1 || continue
@@ -336,6 +342,7 @@ find . -name tox.ini | while read ini ; do
                 populate_wheelhouse "wheel -w $wip_wheelhouse" $require || exit 1
             done
             mv $wip_wheelhouse wheelhouse
+            md5sum *requirements.txt > $md5
         fi
     )
 done
index 996c9cd7f3231e33a00fb0a53410cd0f42874f93..9fef726a21e8574b7813ef66039696b6561cc575 100755 (executable)
@@ -86,5 +86,8 @@ fi
 
 pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install $NO_INDEX --find-links=file://$(pwd)/wheelhouse 'tox >=2.9.1'
 if test -f requirements.txt ; then
+    if ! test -f wheelhouse/md5 || ! md5sum -c wheelhouse/md5 > /dev/null; then
+        NO_INDEX=''
+    fi
     pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install $NO_INDEX --find-links=file://$(pwd)/wheelhouse -r requirements.txt
 fi