From: Kefu Chai Date: Fri, 2 Oct 2020 16:41:06 +0000 (+0800) Subject: admin: be compatible with pip shipped by distro older than v20.2 X-Git-Tag: v17.0.0~969^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=70caf0dfe8ca47711b6fd5bcb5672355d7082c11;p=ceph.git 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 --- diff --git a/admin/build-doc b/admin/build-doc index 239819b98cd8d..f52f17bb66842 100755 --- a/admin/build-doc +++ b/admin/build-doc @@ -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 \