From cca852b2346d99c2129b4e785c289c191175bdb5 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Thu, 22 Sep 2016 18:38:09 +0200
Subject: [PATCH] Hack for bob.buildout

---
 gitlab/before_build.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gitlab/before_build.sh b/gitlab/before_build.sh
index 6a794e6..f620e9a 100755
--- a/gitlab/before_build.sh
+++ b/gitlab/before_build.sh
@@ -9,6 +9,7 @@ check_env PYTHON_VER
 check_env CONDA_PREFIX
 check_env ARCH
 check_env PREFIX
+check_env CI_PROJECT_NAME
 
 WHEELS_REPOSITORY="${DOCSERVER}/software/bob/wheels/gitlab/"
 WHEELS_SERVER=`echo ${DOCSERVER} | sed 's;https\?://;;'`
@@ -54,16 +55,23 @@ else
   log_info "Using python: ${use_python}"
 fi
 
+PIPOPTS="--find-links ${WHEELS_REPOSITORY} --trusted-host ${WHEELS_SERVER}"
+PIPOPTS="${PIPOPTS} --use-wheel --pre"
+# zc.recipe.egg cannot be installed via wheels, so we need this hack...
+if [ "${CI_PROJECT_NAME}" != "bob.buildout" ]; then
+  PIPOPTS="${PIPOPTS} --no-index"
+fi
+
 # Install this package's build dependencies
 if [ -e requirements.txt ]; then
-  run_cmd ${use_pip} install --find-links ${WHEELS_REPOSITORY} --use-wheel --no-index --trusted-host ${WHEELS_SERVER} --pre --requirement requirements.txt
+  run_cmd ${use_pip} install ${PIPOPTS} --requirement requirements.txt
 else
   log_info "No requirements.txt file found, skipping 'pip install <build-deps>'..."
 fi
 
 # Install this package's test dependencies
 if [ -e test-requirements.txt ]; then
-  run_cmd ${use_pip} install --find-links ${WHEELS_REPOSITORY} --use-wheel --no-index --trusted-host ${WHEELS_SERVER} --pre --requirement test-requirements.txt
+  run_cmd ${use_pip} install ${PIPOPTS} --requirement test-requirements.txt
 else
   log_info "No test-requirements.txt file found, skipping 'pip install <test-deps>'..."
 fi
-- 
GitLab