]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
admin/build-doc: rebuild venv if md5 does not match 42658/head
authorKefu Chai <kchai@redhat.com>
Wed, 4 Aug 2021 17:22:50 +0000 (01:22 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 5 Aug 2021 01:08:56 +0000 (09:08 +0800)
we should rebuild the venv if any of the requirements change.

Signed-off-by: Kefu Chai <kchai@redhat.com>
admin/build-doc

index 267d292dd55de4e81ebbcca1dbbd1972a2cdfe83..bbda3eb631ba93419fd35daeb94df3cc2acf8a01 100755 (executable)
@@ -50,8 +50,12 @@ set -e
 
 [ -z "$vdir" ] && vdir="$TOPDIR/build-doc/virtualenv"
 
-if [ ! -e $vdir ]; then
-    python3 -m venv $vdir
+md5=$vdir/md5
+if test -f $md5 && md5sum --check $md5 > /dev/null; then
+    # reusing existing venv
+    :
+else
+    virtualenv --python=python3 $vdir
 
     $vdir/bin/pip install --quiet wheel
     $vdir/bin/pip install --quiet \
@@ -59,6 +63,11 @@ if [ ! -e $vdir ]; then
               -r $TOPDIR/admin/doc-python-common-requirements.txt
     BUILD_DOC=1 $vdir/bin/pip install --quiet \
          -r $TOPDIR/admin/doc-pybind.txt
+    md5sum \
+        $TOPDIR/admin/doc-requirements.txt \
+        $TOPDIR/admin/doc-python-common-requirements.txt \
+        $TOPDIR/admin/doc-pybind.txt \
+        > $md5
 fi
 
 install -d -m0755 \