whitespace cleanup
[gitmo/Role-Tiny.git] / maint / travis-perlbrew
1 BREWVER=${TRAVIS_PERL_VERSION/_*/}
2 BREWOPTS=
3 [[ "${TRAVIS_PERL_VERSION}_" =~ '_thr_' ]] && BREWOPTS="$BREWOPTS -Duseithreads"
4 [[ "$(sed -n -E -e's/^5\.([0-9]+).*/\1/p' <<< $TRAVIS_PERL_VERSION)" -ge 14 ]] && BREWOPTS="$BREWOPTS -j 2"
5
6 if ! perlbrew use | grep -q "Currently using $TRAVIS_PERL_VERSION"; then
7   echo "Building perl $TRAVIS_PERL_VERSION..."
8   PERLBUILD=$(perlbrew install --as $TRAVIS_PERL_VERSION --notest --noman --verbose $BREWOPTS $BREWVER 2>&1)
9   perlbrew use $TRAVIS_PERL_VERSION
10   if ! perlbrew use | grep -q "Currently using $TRAVIS_PERL_VERSION"; then
11     echo "Unable to switch to $TRAVIS_PERL_VERSION - compilation failed...?" 1>&2
12     echo "$PERLBUILD" 1>&2
13     exit 1
14   fi
15 fi
16 perlbrew install-cpanm -f