From f8d774554775a3efdb905f0a55873cce545890c1 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Sat, 17 Sep 2016 03:01:47 -0400 Subject: [PATCH] formula: set TERM to dumb during test Software that tries to print different things (e.g. ANSI color) based on different termcaps often relies on the TERM environment variable, and could fail without it. This results in confusing test issues where certain tests can be successfully run by users testing locally with TERM set, but choke up on our CI. Always setting TERM to dumb leads to better consistency between local tests and CI tests, and saves much probing in certain cases. --- Library/Homebrew/formula.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 2c24c93d7b..88f53a6d12 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1434,8 +1434,10 @@ class Formula old_tmpdir = ENV["TMPDIR"] old_temp = ENV["TEMP"] old_tmp = ENV["TMP"] + old_term = ENV["TERM"] ENV["CURL_HOME"] = old_curl_home || old_home ENV["TMPDIR"] = ENV["TEMP"] = ENV["TMP"] = HOMEBREW_TEMP + ENV["TERM"] = "dumb" mktemp("#{name}-test") do |staging| staging.retain! if ARGV.keep_tmp? @testpath = staging.tmpdir @@ -1457,6 +1459,7 @@ class Formula ENV["TMPDIR"] = old_tmpdir ENV["TEMP"] = old_temp ENV["TMP"] = old_tmp + ENV["TERM"] = old_term end # @private