From: Kefu Chai Date: Thu, 14 Jul 2016 04:29:20 +0000 (+0800) Subject: cmake: do not pass --disable-pip-version-check if not supported X-Git-Tag: v11.0.1~722^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=45176611b3f1fb3173a93ba5bac612c1a74dfe64;p=ceph-ci.git cmake: do not pass --disable-pip-version-check if not supported on older versions of pip, this option is not supported, and --disable-pip-version-check is implied with --no-index. so no need to use them when --no-index is passed to pip. this partially reverts 395f2c5 Signed-off-by: Kefu Chai --- diff --git a/src/ceph-detect-init/CMakeLists.txt b/src/ceph-detect-init/CMakeLists.txt index fdddd9c334a..066be4150cd 100644 --- a/src/ceph-detect-init/CMakeLists.txt +++ b/src/ceph-detect-init/CMakeLists.txt @@ -3,7 +3,7 @@ set(CEPH_DETECT_INIT_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/ceph-detect-init-virtua add_custom_target(ceph-detect-init COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh ${CEPH_DETECT_INIT_VIRTUALENV} && - ${CEPH_DETECT_INIT_VIRTUALENV}/bin/pip install --disable-pip-version-check --no-index --use-wheel --find-links=file:${CMAKE_SOURCE_DIR}/src/ceph-detect-init/wheelhouse -e . + ${CEPH_DETECT_INIT_VIRTUALENV}/bin/pip install --no-index --use-wheel --find-links=file:${CMAKE_SOURCE_DIR}/src/ceph-detect-init/wheelhouse -e . WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/ceph-detect-init COMMENT "ceph-detect-init is being created") add_dependencies(tests ceph-detect-init) diff --git a/src/ceph-disk/CMakeLists.txt b/src/ceph-disk/CMakeLists.txt index 0f8df308095..1bce4d416f0 100644 --- a/src/ceph-disk/CMakeLists.txt +++ b/src/ceph-disk/CMakeLists.txt @@ -3,7 +3,7 @@ set(CEPH_DISK_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/ceph-disk-virtualenv) add_custom_target(ceph-disk COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh ${CEPH_DISK_VIRTUALENV} && - ${CEPH_DISK_VIRTUALENV}/bin/pip install --disable-pip-version-check --no-index --use-wheel --find-links=file:${CMAKE_SOURCE_DIR}/src/ceph-disk/wheelhouse -e . + ${CEPH_DISK_VIRTUALENV}/bin/pip install --no-index --use-wheel --find-links=file:${CMAKE_SOURCE_DIR}/src/ceph-disk/wheelhouse -e . WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/ceph-disk COMMENT "ceph-disk is being created") add_dependencies(tests ceph-disk) diff --git a/src/tools/setup-virtualenv.sh b/src/tools/setup-virtualenv.sh index 47f8ab16d94..444b967368e 100755 --- a/src/tools/setup-virtualenv.sh +++ b/src/tools/setup-virtualenv.sh @@ -20,14 +20,28 @@ rm -fr $DIR mkdir -p $DIR virtualenv --python python2.7 $DIR . $DIR/bin/activate + +if pip --help | grep -q disable-pip-version-check; then + DISABLE_PIP_VERSION_CHECK=--disable-pip-version-check +else + DISABLE_PIP_VERSION_CHECK= +fi + # older versions of pip will not install wrap_console scripts # when using wheel packages -pip --disable-pip-version-check --log $DIR/log.txt install --upgrade 'pip >= 6.1' +pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install --upgrade 'pip >= 6.1' + +if pip --help | grep -q disable-pip-version-check; then + DISABLE_PIP_VERSION_CHECK=--disable-pip-version-check +else + DISABLE_PIP_VERSION_CHECK= +fi + if test -d wheelhouse ; then export NO_INDEX=--no-index fi -pip --disable-pip-version-check --log $DIR/log.txt install $NO_INDEX --use-wheel --find-links=file://$(pwd)/wheelhouse 'tox >=1.9' +pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install $NO_INDEX --use-wheel --find-links=file://$(pwd)/wheelhouse 'tox >=1.9' if test -f requirements.txt ; then - pip --disable-pip-version-check --log $DIR/log.txt install $NO_INDEX --use-wheel --find-links=file://$(pwd)/wheelhouse -r requirements.txt + pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install $NO_INDEX --use-wheel --find-links=file://$(pwd)/wheelhouse -r requirements.txt fi