X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=maint%2Ftravis-ci_scripts%2F20_install.bash;h=ec5c6d5393a1bc25c5d807cbc5d2a06f93927733;hb=2f51deb1f0871f691eecac12c9b4c826836316ce;hp=ace9bc278cf516f0efb154d12668e68c4d3f4a44;hpb=71dd2ecc010836cbbe91e4bf7d4a84191a41dd39;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/maint/travis-ci_scripts/20_install.bash b/maint/travis-ci_scripts/20_install.bash index ace9bc2..ec5c6d5 100755 --- a/maint/travis-ci_scripts/20_install.bash +++ b/maint/travis-ci_scripts/20_install.bash @@ -3,25 +3,49 @@ source maint/travis-ci_scripts/common.bash if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi -TRAVIS_CPAN_MIRROR=$(echo "$PERL_CPANM_OPT" | grep -oP -- '--mirror\s+\S+' | head -n 1 | cut -d ' ' -f 2) -if ! [[ "$TRAVIS_CPAN_MIRROR" =~ "http://" ]] ; then +CPAN_MIRROR=$(echo "$PERL_CPANM_OPT" | grep -oP -- '--mirror\s+\S+' | head -n 1 | cut -d ' ' -f 2) +if ! [[ "$CPAN_MIRROR" =~ "http://" ]] ; then echo_err "Unable to extract primary cpan mirror from PERL_CPANM_OPT - something is wrong" echo_err "PERL_CPANM_OPT: $PERL_CPANM_OPT" - exit 1 + CPAN_MIRROR="http://cpan.develooper.com/" + PERL_CPANM_OPT="$PERL_CPANM_OPT --mirror $CPAN_MIRROR" + echo_err "Using $CPAN_MIRROR for the time being" fi -export PERL_MM_USE_DEFAULT=1 PERL_MM_NONINTERACTIVE=1 PERL_AUTOINSTALL_PREFER_CPAN=1 PERLBREW_CPAN_MIRROR="$TRAVIS_CPAN_MIRROR" +export PERL_MM_USE_DEFAULT=1 PERL_MM_NONINTERACTIVE=1 PERL_AUTOINSTALL_PREFER_CPAN=1 PERLBREW_CPAN_MIRROR="$CPAN_MIRROR" + +# try CPAN's latest offering if requested +if [[ "$DEVREL_DEPS" == "true" ]] ; then + + if [[ "$CLEANTEST" == "true" ]] ; then + echo_err "DEVREL_DEPS combined with CLEANTEST makes no sense - it is only possible with cpanm" + exit 1 + fi + + PERL_CPANM_OPT="$PERL_CPANM_OPT --dev" + + # FIXME work around https://github.com/miyagawa/cpanminus/issues/308 + TEST_BUILDER_BETA_CPAN_TARBALL="M/MS/MSCHWERN/Test-Simple-1.005000_006.tar.gz" +fi # Fixup CPANM_OPT to behave more like a traditional cpan client -export PERL_CPANM_OPT="$( echo $PERL_CPANM_OPT | sed 's/--skip-satisfied//' ) --verbose --no-interactive" +export PERL_CPANM_OPT="--verbose --no-interactive $( echo $PERL_CPANM_OPT | sed 's/--skip-satisfied//' )" 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 $NUMTHREADS $BREWVER" + "perlbrew install --as $BREWVER --notest --verbose $BREWOPTS -j 2 $BREWVER" + + # 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 - # 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 ) fi # configure CPAN.pm - older versions go into an endless loop @@ -31,7 +55,7 @@ CPAN_CFG_SCRIPT=" require CPAN::FirstTime; *CPAN::FirstTime::conf_sites = sub {}; CPAN::Config->load; - \$CPAN::Config->{urllist} = [qw{ $TRAVIS_CPAN_MIRROR }]; + \$CPAN::Config->{urllist} = [qw{ $CPAN_MIRROR }]; \$CPAN::Config->{halt_on_failure} = 1; CPAN::Config->commit; "