diff options
| author | mayeut <mayeut@users.noreply.github.com> | 2015-09-12 02:59:49 +0200 |
|---|---|---|
| committer | mayeut <mayeut@users.noreply.github.com> | 2015-09-12 02:59:49 +0200 |
| commit | 41a96aee5af59cc18f4292becc9f5122f6589f2d (patch) | |
| tree | 5808891cf817f4566478f0892fb130ac40bf0139 | |
| parent | 897d2c0b757dc906b9d69d5759b69b051fa47a1f (diff) | |
Fix fetching of openjpeg-data
Fetch from master branch if TRAVIS_BRANCH doesn’t exist
| -rwxr-xr-x | tools/travis-ci/install.sh | 14 | ||||
| -rwxr-xr-x | tools/travis-ci/run.sh | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/tools/travis-ci/install.sh b/tools/travis-ci/install.sh index d1ce8885..9130ee95 100755 --- a/tools/travis-ci/install.sh +++ b/tools/travis-ci/install.sh @@ -22,12 +22,20 @@ trap exit ERR # travis-ci doesn't dump cmake version in system info, let's print it cmake --version +OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd) + # We need test data if [ "${TRAVIS_BRANCH:-}" == "" ]; then - TRAVIS_BRANCH=master #default to master + TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to same branch as we're setting up +fi +OPJ_DATA_HAS_BRANCH=$(git ls-remote --heads git://github.com/uclouvain/openjpeg-data.git ${TRAVIS_BRANCH} | wc -l) +if [ ${OPJ_DATA_HAS_BRANCH} -ne 0 ]; then + OPJ_DATA_BRANCH=${TRAVIS_BRANCH} +else + OPJ_DATA_BRANCH=master #default to master fi -echo "Cloning openjpeg-data from ${TRAVIS_BRANCH} branch" -git clone --depth=1 --branch=${TRAVIS_BRANCH} git://github.com/uclouvain/openjpeg-data.git data +echo "Cloning openjpeg-data from ${OPJ_DATA_BRANCH} branch" +git clone --depth=1 --branch=${OPJ_DATA_BRANCH} git://github.com/uclouvain/openjpeg-data.git data # We need jpylyzer for the test suite echo "Retrieving jpylyzer" diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index d95475e5..36bcc0d4 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -60,7 +60,7 @@ fi if [ "${TRAVIS_BRANCH:-}" == "" ]; then echo "Guessing branch" - TRAVIS_BRANCH=$(git -C ../openjpeg branch | grep '*' | tr -d '*[[:blank:]]') #default to master + TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to master fi OPJ_BUILDNAME=${OPJ_OS_NAME}-${OPJ_CC_VERSION}-${TRAVIS_BRANCH} |
