From d4b0599a86b5d0242477597506af69df24784523 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sat, 26 Apr 2014 23:31:39 -0700 Subject: --config -> config --- Library/Contributions/brew_bash_completion.sh | 2 +- Library/Contributions/brew_zsh_completion.zsh | 2 +- Library/Contributions/cmd/brew-gist-logs.rb | 2 +- Library/Contributions/cmd/brew-test-bot.rb | 2 +- Library/Contributions/manpages/brew.1.md | 10 +- Library/Homebrew/cmd/--config.rb | 149 -------------------------- Library/Homebrew/cmd/config.rb | 149 ++++++++++++++++++++++++++ Library/Homebrew/cmd/help.rb | 2 +- Library/Homebrew/exceptions.rb | 2 +- Library/Homebrew/formula.rb | 2 +- Library/Homebrew/os/mac/hardware.rb | 2 +- Library/brew.rb | 2 +- 12 files changed, 163 insertions(+), 163 deletions(-) delete mode 100644 Library/Homebrew/cmd/--config.rb create mode 100644 Library/Homebrew/cmd/config.rb (limited to 'Library') diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh index ee2bcbed3..a0ab0faca 100644 --- a/Library/Contributions/brew_bash_completion.sh +++ b/Library/Contributions/brew_bash_completion.sh @@ -450,7 +450,7 @@ _brew () 2>/dev/null | sed -e "s/\.rb//g" -e "s/brew-//g" \ -e "s/.*\///g") __brewcomp " - --cache --cellar --config + --cache --cellar config --env --prefix --repository audit cat diff --git a/Library/Contributions/brew_zsh_completion.zsh b/Library/Contributions/brew_zsh_completion.zsh index ab889d405..0cae580fb 100644 --- a/Library/Contributions/brew_zsh_completion.zsh +++ b/Library/Contributions/brew_zsh_completion.zsh @@ -77,7 +77,7 @@ local -a formulae installed_formulae installed_taps outdated_formulae running_se _arguments \ '(-v)-v[verbose]' \ '(--cellar)--cellar[brew cellar]' \ - '(--config)--config[brew configuration]' \ + '(config)--config[brew configuration]' \ '(--env)--env[brew environment]' \ '(--repository)--repository[brew repository]' \ '(--version)--version[version information]' \ diff --git a/Library/Contributions/cmd/brew-gist-logs.rb b/Library/Contributions/cmd/brew-gist-logs.rb index 102bf7660..7d4e1c110 100755 --- a/Library/Contributions/cmd/brew-gist-logs.rb +++ b/Library/Contributions/cmd/brew-gist-logs.rb @@ -37,7 +37,7 @@ def load_logs name end def append_config files - files['config.out'] = {:content => `brew --config 2>&1`} + files['config.out'] = {:content => `brew config 2>&1`} end def append_doctor files diff --git a/Library/Contributions/cmd/brew-test-bot.rb b/Library/Contributions/cmd/brew-test-bot.rb index 9832693c8..fa0075884 100755 --- a/Library/Contributions/cmd/brew-test-bot.rb +++ b/Library/Contributions/cmd/brew-test-bot.rb @@ -276,7 +276,7 @@ class Test return if ARGV.include? "--skip-setup" test "brew doctor" test "brew --env" - test "brew --config" + test "brew config" end def formula formula diff --git a/Library/Contributions/manpages/brew.1.md b/Library/Contributions/manpages/brew.1.md index be2f8c98c..8e9f6ba7b 100644 --- a/Library/Contributions/manpages/brew.1.md +++ b/Library/Contributions/manpages/brew.1.md @@ -67,6 +67,11 @@ Note that these flags should only appear after a command. * `commands`: Show a list of built-in and external commands. + * `config`: + Show Homebrew and system configuration useful for debugging. If you file + a bug report, you will likely be asked for this information if you do not + provide it. + * `create [--autotools|--cmake] [--no-fetch] [--set-name ] [--set-version ]`: Generate a formula for the downloadable file at and open it in the editor. Homebrew will attempt to automatically derive the formula name @@ -391,11 +396,6 @@ Note that these flags should only appear after a command. Display the location in the cellar where would be installed, without any sort of versioned directory as the last path. - * `--config`: - Show Homebrew and system configuration useful for debugging. If you file - a bug report, you will likely be asked for this information if you do not - provide it. - * `--env`: Show a summary of the Homebrew build environment. diff --git a/Library/Homebrew/cmd/--config.rb b/Library/Homebrew/cmd/--config.rb deleted file mode 100644 index a6df1a2c6..000000000 --- a/Library/Homebrew/cmd/--config.rb +++ /dev/null @@ -1,149 +0,0 @@ -require 'hardware' - -module Homebrew extend self - def __config - dump_verbose_config - end - - def llvm - @llvm ||= MacOS.llvm_build_version - end - - def gcc_42 - @gcc_42 ||= MacOS.gcc_42_build_version - end - - def gcc_40 - @gcc_40 ||= MacOS.gcc_40_build_version - end - - def clang - @clang ||= MacOS.clang_version - end - - def clang_build - @clang_build ||= MacOS.clang_build_version - end - - def xcode - if instance_variable_defined?(:@xcode) - @xcode - elsif MacOS::Xcode.installed? - @xcode = MacOS::Xcode.version - @xcode += " => #{MacOS::Xcode.prefix}" unless MacOS::Xcode.default_prefix? - @xcode - end - end - - def clt - if instance_variable_defined?(:@clt) - @clt - elsif MacOS::CLT.installed? && MacOS::Xcode.version >= "4.3" - @clt = MacOS::CLT.version - end - end - - def head - head = HOMEBREW_REPOSITORY.cd do - `git rev-parse --verify -q HEAD 2>/dev/null`.chomp - end - if head.empty? then "(none)" else head end - end - - def origin - origin = HOMEBREW_REPOSITORY.cd do - `git config --get remote.origin.url 2>/dev/null`.chomp - end - if origin.empty? then "(none)" else origin end - end - - def describe_path path - return "N/A" if path.nil? - realpath = path.realpath - if realpath == path then path else "#{path} => #{realpath}" end - end - - def describe_x11 - return "N/A" unless MacOS::XQuartz.installed? - return "#{MacOS::XQuartz.version} => #{describe_path(MacOS::XQuartz.prefix)}" - end - - def describe_perl - describe_path(which 'perl') - end - - def describe_python - describe_path(which 'python') - end - - def describe_ruby - describe_path(which 'ruby') - end - - def hardware - "CPU: #{Hardware.cores_as_words}-core #{Hardware::CPU.bits}-bit #{Hardware::CPU.family}" - end - - def kernel - `uname -m`.chomp - end - - def macports_or_fink - @ponk ||= MacOS.macports_or_fink - @ponk.join(", ") unless @ponk.empty? - end - - # we try to keep output minimal - def dump_build_config - puts "HOMEBREW_VERSION: #{HOMEBREW_VERSION}" - puts "HEAD: #{head}" - puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}" if HOMEBREW_PREFIX.to_s != "/usr/local" - puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.to_s != "#{HOMEBREW_PREFIX}/Cellar" - puts hardware - puts "OS X: #{MACOS_FULL_VERSION}-#{kernel}" - puts "Xcode: #{xcode}" if xcode - puts "CLT: #{clt}" if clt - puts "#{RUBY_PATH}:\n #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}" if RUBY_VERSION.to_f != 1.8 - - unless MacOS.compilers_standard? - puts "GCC-4.0: build #{gcc_40}" if gcc_40 - puts "GCC-4.2: build #{gcc_42}" if gcc_42 - puts "LLVM-GCC: build #{llvm}" if llvm - puts "Clang: #{clang ? "#{clang} build #{clang_build}" : "N/A"}" - end - - puts "MacPorts/Fink: #{macports_or_fink}" if macports_or_fink - - puts "X11: #{describe_x11}" - end - - def write_build_config f - stdout = $stdout - $stdout = f - Homebrew.dump_build_config - ensure - $stdout = stdout - end - - def dump_verbose_config - puts "HOMEBREW_VERSION: #{HOMEBREW_VERSION}" - puts "ORIGIN: #{origin}" - puts "HEAD: #{head}" - puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}" - puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" - puts hardware - puts "OS X: #{MACOS_FULL_VERSION}-#{kernel}" - puts "Xcode: #{xcode}" if xcode - puts "CLT: #{clt}" if clt - puts "GCC-4.0: build #{gcc_40}" if gcc_40 - puts "GCC-4.2: build #{gcc_42}" if gcc_42 - puts "LLVM-GCC: build #{llvm}" if llvm - puts "Clang: #{clang ? "#{clang} build #{clang_build}" : "N/A"}" - puts "MacPorts/Fink: #{macports_or_fink}" if macports_or_fink - puts "X11: #{describe_x11}" - puts "System Ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}" - puts "Perl: #{describe_perl}" - puts "Python: #{describe_python}" - puts "Ruby: #{describe_ruby}" - end -end diff --git a/Library/Homebrew/cmd/config.rb b/Library/Homebrew/cmd/config.rb new file mode 100644 index 000000000..fb3fb7772 --- /dev/null +++ b/Library/Homebrew/cmd/config.rb @@ -0,0 +1,149 @@ +require 'hardware' + +module Homebrew extend self + def config + dump_verbose_config + end + + def llvm + @llvm ||= MacOS.llvm_build_version + end + + def gcc_42 + @gcc_42 ||= MacOS.gcc_42_build_version + end + + def gcc_40 + @gcc_40 ||= MacOS.gcc_40_build_version + end + + def clang + @clang ||= MacOS.clang_version + end + + def clang_build + @clang_build ||= MacOS.clang_build_version + end + + def xcode + if instance_variable_defined?(:@xcode) + @xcode + elsif MacOS::Xcode.installed? + @xcode = MacOS::Xcode.version + @xcode += " => #{MacOS::Xcode.prefix}" unless MacOS::Xcode.default_prefix? + @xcode + end + end + + def clt + if instance_variable_defined?(:@clt) + @clt + elsif MacOS::CLT.installed? && MacOS::Xcode.version >= "4.3" + @clt = MacOS::CLT.version + end + end + + def head + head = HOMEBREW_REPOSITORY.cd do + `git rev-parse --verify -q HEAD 2>/dev/null`.chomp + end + if head.empty? then "(none)" else head end + end + + def origin + origin = HOMEBREW_REPOSITORY.cd do + `git config --get remote.origin.url 2>/dev/null`.chomp + end + if origin.empty? then "(none)" else origin end + end + + def describe_path path + return "N/A" if path.nil? + realpath = path.realpath + if realpath == path then path else "#{path} => #{realpath}" end + end + + def describe_x11 + return "N/A" unless MacOS::XQuartz.installed? + return "#{MacOS::XQuartz.version} => #{describe_path(MacOS::XQuartz.prefix)}" + end + + def describe_perl + describe_path(which 'perl') + end + + def describe_python + describe_path(which 'python') + end + + def describe_ruby + describe_path(which 'ruby') + end + + def hardware + "CPU: #{Hardware.cores_as_words}-core #{Hardware::CPU.bits}-bit #{Hardware::CPU.family}" + end + + def kernel + `uname -m`.chomp + end + + def macports_or_fink + @ponk ||= MacOS.macports_or_fink + @ponk.join(", ") unless @ponk.empty? + end + + # we try to keep output minimal + def dump_build_config + puts "HOMEBREW_VERSION: #{HOMEBREW_VERSION}" + puts "HEAD: #{head}" + puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}" if HOMEBREW_PREFIX.to_s != "/usr/local" + puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.to_s != "#{HOMEBREW_PREFIX}/Cellar" + puts hardware + puts "OS X: #{MACOS_FULL_VERSION}-#{kernel}" + puts "Xcode: #{xcode}" if xcode + puts "CLT: #{clt}" if clt + puts "#{RUBY_PATH}:\n #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}" if RUBY_VERSION.to_f != 1.8 + + unless MacOS.compilers_standard? + puts "GCC-4.0: build #{gcc_40}" if gcc_40 + puts "GCC-4.2: build #{gcc_42}" if gcc_42 + puts "LLVM-GCC: build #{llvm}" if llvm + puts "Clang: #{clang ? "#{clang} build #{clang_build}" : "N/A"}" + end + + puts "MacPorts/Fink: #{macports_or_fink}" if macports_or_fink + + puts "X11: #{describe_x11}" + end + + def write_build_config f + stdout = $stdout + $stdout = f + Homebrew.dump_build_config + ensure + $stdout = stdout + end + + def dump_verbose_config + puts "HOMEBREW_VERSION: #{HOMEBREW_VERSION}" + puts "ORIGIN: #{origin}" + puts "HEAD: #{head}" + puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}" + puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" + puts hardware + puts "OS X: #{MACOS_FULL_VERSION}-#{kernel}" + puts "Xcode: #{xcode}" if xcode + puts "CLT: #{clt}" if clt + puts "GCC-4.0: build #{gcc_40}" if gcc_40 + puts "GCC-4.2: build #{gcc_42}" if gcc_42 + puts "LLVM-GCC: build #{llvm}" if llvm + puts "Clang: #{clang ? "#{clang} build #{clang_build}" : "N/A"}" + puts "MacPorts/Fink: #{macports_or_fink}" if macports_or_fink + puts "X11: #{describe_x11}" + puts "System Ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}" + puts "Perl: #{describe_perl}" + puts "Python: #{describe_python}" + puts "Ruby: #{describe_ruby}" + end +end diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb index b76e363f7..d185c41e2 100644 --- a/Library/Homebrew/cmd/help.rb +++ b/Library/Homebrew/cmd/help.rb @@ -12,7 +12,7 @@ Example usage: Troubleshooting: brew doctor brew install -vd FORMULA - brew [--env | --config] + brew [--env | config] Brewing: brew create [URL [--no-fetch]] diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 8c4abc126..7cdd24cb1 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -190,7 +190,7 @@ class BuildError < Homebrew::InstallationError puts " #{tap_issues_url}" end else - require 'cmd/--config' + require 'cmd/config' require 'cmd/--env' unless formula.core_formula? diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 9b8de904e..d6a6f60e1 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -570,7 +570,7 @@ class Formula f.flush Kernel.system "/usr/bin/tail", "-n", "5", logfn unless ARGV.verbose? f.puts - require 'cmd/--config' + require 'cmd/config' Homebrew.write_build_config(f) raise BuildError.new(self, cmd, args, $?) end diff --git a/Library/Homebrew/os/mac/hardware.rb b/Library/Homebrew/os/mac/hardware.rb index e2778590a..7bda71fa4 100644 --- a/Library/Homebrew/os/mac/hardware.rb +++ b/Library/Homebrew/os/mac/hardware.rb @@ -58,7 +58,7 @@ module MacCPUs :g4e # PowerPC 7450 when 100 # This is the only 64-bit PPC CPU type, so it's useful - # to distinguish in `brew --config` output and in bottle tags + # to distinguish in `brew config` output and in bottle tags MacOS.prefer_64_bit? ? :g5_64 : :g5 # PowerPC 970 else :dunno diff --git a/Library/brew.rb b/Library/brew.rb index a27497912..592719340 100755 --- a/Library/brew.rb +++ b/Library/brew.rb @@ -85,7 +85,7 @@ begin 'dr' => 'doctor', '--repo' => '--repository', 'environment' => '--env', - '-c1' => '--config', + '--config' => 'config', } cmd = ARGV.shift -- cgit v1.2.3