]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: do not pass --disable-pip-version-check if not supported
authorKefu Chai <kchai@redhat.com>
Thu, 14 Jul 2016 04:29:20 +0000 (12:29 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 16 Jul 2016 04:00:46 +0000 (12:00 +0800)
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 <kchai@redhat.com>
src/ceph-detect-init/CMakeLists.txt
src/ceph-disk/CMakeLists.txt
src/tools/setup-virtualenv.sh

index fdddd9c334a3b92dae6c82a9befc70edaa976fcd..066be4150cda5ed43a5a9914dccc4466520f2636 100644 (file)
@@ -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)
index 0f8df3080959e29cf046b81426f4f8bafad83bec..1bce4d416f00775d5baa892cba74eb7ef41c5d0e 100644 (file)
@@ -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)
index 47f8ab16d945e0c5f76d5f07d3c55bb44e4bc355..444b967368ed61b5442fd207e77813e4f6172f8c 100755 (executable)
@@ -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