admin: be compatible with pip shipped by distro older than v20.2

pip v20.2 introduced a new option named --use-feature, which is not
available with <20.2. so we need to check for it before using it. see
also
https://pip.pypa.io/en/stable/user_guide/#changes-to-the-pip-dependency-resolver-in-20-2-2020

Fixes: https://tracker.ceph.com/issues/47636
Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2020-10-03 00:41:06 +08:00
parent 87f23d0350
commit 70caf0dfe8

View File

@ -57,7 +57,14 @@ cd build-doc
if [ ! -e $vdir ]; then
virtualenv --python=python3 $vdir
fi
$vdir/bin/pip install --use-feature=2020-resolver --quiet -r $TOPDIR/admin/doc-requirements.txt -r $TOPDIR/admin/doc-python-common-requirements.txt
# be compatible with pip shipped by distro older v20.2
if $vdir/bin/pip --use-feature=2020-resolver >/dev/null 2>&1 ; then
PIP_INSTALL="$vdir/bin/pip install --use-feature=2020-resolver"
else
PIP_INSTALL="$vdir/bin/pip install"
fi
$PIP_INSTALL --quiet -r $TOPDIR/admin/doc-requirements.txt -r $TOPDIR/admin/doc-python-common-requirements.txt
install -d -m0755 \
$TOPDIR/build-doc/output/html \