Fix fetching of openjpeg-data

Fetch from master branch if TRAVIS_BRANCH doesn’t exist
This commit is contained in:
mayeut 2015-09-12 02:59:49 +02:00
parent 897d2c0b75
commit 41a96aee5a
2 changed files with 12 additions and 4 deletions

View File

@ -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
echo "Cloning openjpeg-data from ${TRAVIS_BRANCH} branch"
git clone --depth=1 --branch=${TRAVIS_BRANCH} git://github.com/uclouvain/openjpeg-data.git data
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 ${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"

View File

@ -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}