diff options
| author | Mike McQuaid | 2017-11-04 16:35:24 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2017-11-05 14:45:36 +0000 |
| commit | 4892465fc45746a53048f18ab2c9f129a90c8244 (patch) | |
| tree | c024c39214a39408cee0b26cf57f99c5c7880ab5 /Library/Homebrew/system_config.rb | |
| parent | 1b698481195eea4e462d8a9702d60f4592ade725 (diff) | |
| download | brew-4892465fc45746a53048f18ab2c9f129a90c8244.tar.bz2 | |
system_config: output most HOMEBREW_* variables.
Exclude the boring ones and exclude some that are already printed that
are just using their default values. HOMEBREW_PREFIX is the only one
where we’re always interested in the output to quickly communicate it.
Diffstat (limited to 'Library/Homebrew/system_config.rb')
| -rw-r--r-- | Library/Homebrew/system_config.rb | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/Library/Homebrew/system_config.rb b/Library/Homebrew/system_config.rb index df88d7e7e..e7e60c985 100644 --- a/Library/Homebrew/system_config.rb +++ b/Library/Homebrew/system_config.rb @@ -169,10 +169,47 @@ class SystemConfig else f.puts "Core tap: N/A" end + defaults_hash = { + HOMEBREW_PREFIX: "/usr/local", + HOMEBREW_REPOSITORY: "/usr/local/Homebrew", + HOMEBREW_CELLAR: "/usr/local/Cellar", + HOMEBREW_CACHE: "#{ENV["HOME"]}/Library/Caches/Homebrew", + }.freeze + boring_keys = %w[ + HOMEBREW_BROWSER + HOMEBREW_EDITOR + + HOMEBREW_ANALYTICS_ID + HOMEBREW_ANALYTICS_USER_UUID + HOMEBREW_BREW_FILE + HOMEBREW_COMMAND_DEPTH + HOMEBREW_CURL + HOMEBREW_LIBRARY + HOMEBREW_MACOS_VERSION + HOMEBREW_RUBY_PATH + HOMEBREW_SYSTEM + HOMEBREW_OS_VERSION + HOMEBREW_PATH + HOMEBREW_PROCESSOR + HOMEBREW_PRODUCT + HOMEBREW_USER_AGENT + HOMEBREW_USER_AGENT_CURL + HOMEBREW_VERSION + ].freeze f.puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}" - f.puts "HOMEBREW_REPOSITORY: #{HOMEBREW_REPOSITORY}" - f.puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" - f.puts "HOMEBREW_BOTTLE_DOMAIN: #{BottleSpecification::DEFAULT_DOMAIN}" + if defaults_hash[:HOMEBREW_REPOSITORY] != HOMEBREW_REPOSITORY.to_s + f.puts "HOMEBREW_REPOSITORY: #{HOMEBREW_REPOSITORY}" + end + if defaults_hash[:HOMEBREW_CELLAR] != HOMEBREW_CELLAR.to_s + f.puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" + end + ENV.sort.each do |key, value| + next unless key.start_with?("HOMEBREW_") + next if boring_keys.include?(key) + next if defaults_hash[key.to_sym] == value + value = "set" if key =~ /(cookie|key|token)/i + f.puts "#{key}: #{value}" + end f.puts hardware if hardware f.puts "Homebrew Ruby: #{describe_homebrew_ruby}" f.puts "GCC-4.0: build #{gcc_4_0}" unless gcc_4_0.null? |
