From 0fbcf0a24c91f08b456d516dc85c0b524d1b5ae6 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 13 Apr 2016 12:47:50 +0600 Subject: [PATCH] Fix ghc version comparison in travis scripts --- ci/travis_ci_install | 5 ++++- ci/travis_ci_script | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ci/travis_ci_install b/ci/travis_ci_install index f69d67c..ad0d9ed 100755 --- a/ci/travis_ci_install +++ b/ci/travis_ci_install @@ -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 diff --git a/ci/travis_ci_script b/ci/travis_ci_script index de9ac4f..8d1df67 100755 --- a/ci/travis_ci_script +++ b/ci/travis_ci_script @@ -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}"