Turns out Travis CPAN mirror is not local, add a fallback
[dbsrgits/DBIx-Class.git] / maint / travis-ci_scripts / common.bash
index ee8fa00..9ee3e0a 100755 (executable)
@@ -32,16 +32,13 @@ run_or_err() {
 extract_prereqs() {
   # once --verbose is set, --no-verbose can't disable it
   # do this by hand
-  ORIG_CPANM_OPT="$PERL_CPANM_OPT"
-  PERL_CPANM_OPT="$( echo $PERL_CPANM_OPT | sed 's/--verbose//' )"
+  local PERL_CPANM_OPT="$( echo $PERL_CPANM_OPT | sed 's/--verbose\s*//' )"
 
   # hack-hack-hack
   LASTEXIT=0
   COMBINED_OUT="$( { stdout="$(cpanm --quiet --scandeps --format tree "$@")" ; } 2>&1; echo "!!!STDERRSTDOUTSEPARATOR!!!$stdout")" \
     || LASTEXIT=$?
 
-  PERL_CPANM_OPT="$ORIG_CPANM_OPT"
-
   OUT=${COMBINED_OUT#*!!!STDERRSTDOUTSEPARATOR!!!}
   ERR=$(grep -v " is up to date." <<< "${COMBINED_OUT%!!!STDERRSTDOUTSEPARATOR!!!*}")