Fix ghc version comparison in travis scripts

This commit is contained in:
Dmitry Ivanov 2016-04-13 12:47:50 +06:00
parent e42c5799e3
commit 0fbcf0a24c
2 changed files with 8 additions and 2 deletions

View File

@ -1,7 +1,10 @@
#!/bin/bash
set -ex
cabal --version
if [[ "${GHCVER}" > "7.2.2" ]] ; then
GHC_IS_OLD=$(python -c "from distutils.version import StrictVersion as SV; print '$GHCVER' != 'head' and SV('$GHCVER') < SV('7.2.3')")
if [[ "False" == "$GHC_IS_OLD" ]] ; then
/opt/cabal/${CABALVER}/bin/cabal install --only-dependencies --enable-tests
else
/opt/cabal/${CABALVER}/bin/cabal install --only-dependencies

View File

@ -1,6 +1,9 @@
#!/bin/bash
set -ex
if [[ "${GHCVER}" > "7.2.2" ]] ; then
GHC_IS_OLD=$(python -c "from distutils.version import StrictVersion as SV; print '$GHCVER' != 'head' and SV('$GHCVER') < SV('7.2.3')")
if [[ "False" == "$GHC_IS_OLD" ]] ; then
/opt/cabal/${CABALVER}/bin/cabal configure --enable-tests && /opt/cabal/${CABALVER}/bin/cabal build && /opt/cabal/${CABALVER}/bin/cabal test
else
echo "Skipping tests on ${GHCVER}"