From: Peter Rabbitson Date: Fri, 27 Dec 2013 05:53:06 +0000 (+0100) Subject: Extra poison - have our latest stable in PERL5LIB X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6d74b82cc;p=dbsrgits%2FDBIx-Class-Historic.git Extra poison - have our latest stable in PERL5LIB --- diff --git a/maint/travis-ci_scripts/30_before_script.bash b/maint/travis-ci_scripts/30_before_script.bash index 01d879a..33f050e 100755 --- a/maint/travis-ci_scripts/30_before_script.bash +++ b/maint/travis-ci_scripts/30_before_script.bash @@ -3,19 +3,33 @@ source maint/travis-ci_scripts/common.bash if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi -# poison the environment - basically look through lib, find all mentioned -# ENVvars and set them to true and see if anything explodes +# poison the environment if [[ "$POISON_ENV" = "true" ]] ; then + + # look through lib, find all mentioned ENVvars and set them + # to true and see if anything explodes for var in $(grep -P '\$ENV\{' -r lib/ | grep -oP 'DBIC_\w+' | sort -u | grep -v DBIC_TRACE) ; do if [[ -z "${!var}" ]] ; then export $var=1 fi done + # bogus nonexisting DBI_* export DBI_DSN="dbi:ODBC:server=NonexistentServerAddress" export DBI_DRIVER="ADO" + # make sure tests do not rely on implicid order of returned results export DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER=1 + + # emulate a local::lib-like env + # trick cpanm into executing true as shell - we just need the find+unpack + run_or_err "Downloading latest stable DBIC from CPAN" \ + "SHELL=/bin/true cpanm --look DBIx::Class" + + export PERL5LIB="$( ls -d ~/.cpanm/latest-build/DBIx-Class-*/lib | tail -n1 ):$PERL5LIB" + + # perldoc -l searches $(pwd)/lib in addition to PERL5LIB etc, hence the cd / + echo_err "Latest stable DBIC (without deps) locatable via \$PERL5LIB at $(cd / && perldoc -l DBIx::Class)" fi if [[ "$CLEANTEST" = "true" ]]; then @@ -26,7 +40,7 @@ if [[ "$CLEANTEST" = "true" ]]; then # effects from travis preinstalls) # trick cpanm into executing true as shell - we just need the find+unpack - run_or_err "Downloading DBIC inc/ from CPAN" \ + [[ -d ~/.cpanm/latest-build/DBIx-Class-*/inc ]] || run_or_err "Downloading latest stable DBIC inc/ from CPAN" \ "SHELL=/bin/true cpanm --look DBIx::Class" mv ~/.cpanm/latest-build/DBIx-Class-*/inc . @@ -49,7 +63,7 @@ if [[ "$CLEANTEST" = "true" ]]; then elif ! CPAN_is_sane ; then # no configure_requires - we will need the usual suspects anyway - # without pre-installign these in one pass things like extract_prereqs won't work + # without pre-installing these in one pass things like extract_prereqs won't work installdeps ExtUtils::MakeMaker ExtUtils::CBuilder Module::Build fi