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 #!/bin/bash
set -ex set -ex
cabal --version 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 /opt/cabal/${CABALVER}/bin/cabal install --only-dependencies --enable-tests
else else
/opt/cabal/${CABALVER}/bin/cabal install --only-dependencies /opt/cabal/${CABALVER}/bin/cabal install --only-dependencies

View File

@ -1,6 +1,9 @@
#!/bin/bash #!/bin/bash
set -ex 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 /opt/cabal/${CABALVER}/bin/cabal configure --enable-tests && /opt/cabal/${CABALVER}/bin/cabal build && /opt/cabal/${CABALVER}/bin/cabal test
else else
echo "Skipping tests on ${GHCVER}" echo "Skipping tests on ${GHCVER}"