run_or_err() {
echo_err -n "$(tstamp) $1 ... "
- LASTOUT=$( bash -c "$2" 2>&1)
- LASTEXIT=$?
+ LASTEXIT=0
+ LASTOUT=$( bash -c "$2" 2>&1 ) || LASTEXIT=$?
+
if [[ "$LASTEXIT" != "0" ]] ; then
echo_err -e "FAILED !!!\nCommand executed:\n$2\nSTDOUT+STDERR:\n$LASTOUT"
return $LASTEXIT
export PERL_CPANM_OPT="$( echo $PERL_CPANM_OPT | sed 's/--skip-satisfied//' )"
if [[ -n "$BREWVER" ]] ; then
- # if this is not master and not a smoke/ branch - cancel all testing
- if [[ "$TRAVIS_BRANCH" =~ "topic/" ]]; then
+ # .travis.yml already restricts branches to master, topic/* and smoke/*
+ # do some extra short-circuiting here
+
+ # when smoking master do not attempt bleadperl (not release-critical)
+ if [[ "$TRAVIS_BRANCH" = "master" ]] && [[ "$BREWVER" = "blead" ]]; then
+ export SHORT_CIRCUIT_SMOKE=1
+ # on topic/ branches test only with travis perls
+ elif [[ "$TRAVIS_BRANCH" =~ "topic/" ]]; then
export SHORT_CIRCUIT_SMOKE=1
+ fi
+
+ if [[ -n "$SHORT_CIRCUIT_SMOKE" ]]; then
echo_err "$(tstamp) non-smoke branch and custom perl compilation requested - bailing out"
sleep 20 # give the console time to attach, otherwise it hangs
return # this is like an `exit 0` in sourcing
fi
run_or_err "Compiling/installing Perl $BREWVER (without testing, may take up to 5 minutes)" \
- "perlbrew install --as $BREWVER --notest $BREWOPTS -j $NUMTHREADS perl-$BREWVER"
+ "perlbrew install --as $BREWVER --notest --verbose $BREWOPTS -j $NUMTHREADS $BREWVER"
+ sync
perlbrew use $BREWVER
fi
extract_prereqs() {
# hack-hack-hack
+ LASTEXIT=0
COMBINED_OUT="$( { stdout="$(cpanm --quiet --scandeps --format tree "$@")" ; } 2>&1; echo "!!!STDERRSTDOUTSEPARATOR!!!$stdout")" \
|| LASTEXIT=$?
OUT=${COMBINED_OUT#*!!!STDERRSTDOUTSEPARATOR!!!}
ERR=$(grep -v " is up to date." <<< "${COMBINED_OUT%!!!STDERRSTDOUTSEPARATOR!!!*}")
- [[ -n "$LASTEXIT" ]] || LASTEXIT=0
if [[ "$LASTEXIT" != "0" ]] || [[ -n "$ERR" ]] ; then
echo_err "$(echo -e "Error occured (exit code $LASTEXIT) retrieving dependencies of $@:\n$ERR\n$OUT")"
exit 1
fi
# throw away non-children (what was in $@), throw away ascii art, convert to modnames
- perl -p -e 's/^\s*[^\\].+//; s/^[^A-Za-z]+//; s/\-[^\-]+$/ /; s/\-/::/g' <<< "$OUT"
+ perl -p -e 's/^[a-z].+//i; s/^[^a-z]+//i; s/\-[^\-]+$/ /; s/\-/::/g' <<< "$OUT"
}
parallel_installdeps_notest() {
# (e.g. once Carp is upgraded there's no more Carp::Heavy)
#
parallel_installdeps_notest ExtUtils::MakeMaker
- parallel_installdeps_notest Module::Build Carp
- parallel_installdeps_notest Module::Runtime ExtUtils::Depends File::Spec
- parallel_installdeps_notest Test::Exception Data::Dumper LWP
+ parallel_installdeps_notest Carp
+ parallel_installdeps_notest Module::Build
+ parallel_installdeps_notest Module::Runtime ExtUtils::Depends File::Spec Data::Dumper
+ parallel_installdeps_notest Test::Exception LWP
parallel_installdeps_notest Test::Fatal Test::Warn bareword::filehandles
parallel_installdeps_notest namespace::clean Class::XSAccessor MRO::Compat
parallel_installdeps_notest DBD::SQLite Moo Class::Accessor::Grouped