From: Peter Rabbitson Date: Mon, 22 Jul 2013 04:26:25 +0000 (+0200) Subject: perlbrew exits with 0 if `perlbrew use` fails :( X-Git-Tag: v0.08260~195 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d2b1fee9464c3d4ac36d514ee19e5acb9ae0f41e;p=dbsrgits%2FDBIx-Class.git perlbrew exits with 0 if `perlbrew use` fails :( --- diff --git a/maint/travis-ci_scripts/20_install.bash b/maint/travis-ci_scripts/20_install.bash index 6cc1a49..6010f76 100755 --- a/maint/travis-ci_scripts/20_install.bash +++ b/maint/travis-ci_scripts/20_install.bash @@ -20,9 +20,17 @@ if [[ -n "$BREWVER" ]] ; then run_or_err "Compiling/installing Perl $BREWVER (without testing, may take up to 5 minutes)" \ "perlbrew install --as $BREWVER --notest --verbose $BREWOPTS -j 2 $BREWVER" - # can not do 'perlbrew uss' in the run_or_err subshell above - perlbrew use $BREWVER || \ - ( echo_err -e "Unable to switch to $BREWVER - compillation failed?\n$LASTOUT"; exit 1 ) + # can not do 'perlbrew uss' in the run_or_err subshell above, or a $() + # furthermore `perlbrew use` returns 0 regardless of whether the perl is + # found (won't be there unless compilation suceeded, wich *ALSO* returns 0) + perlbrew use $BREWVER + + if [[ "$( perlbrew use | grep -oP '(?<=Currently using ).+' )" != "$BREWVER" ]] ; then + echo_err "Unable to switch to $BREWVER - compilation failed...?" + echo_err "$LASTOUT" + exit 1 + fi + fi # configure CPAN.pm - older versions go into an endless loop