diff --git a/lib/homebrew-fork/Library/Homebrew/extend/fileutils.rb b/lib/homebrew-fork/Library/Homebrew/extend/fileutils.rb index 3f5f40eb66872..283e45e6a98e4 100644 --- a/lib/homebrew-fork/Library/Homebrew/extend/fileutils.rb +++ b/lib/homebrew-fork/Library/Homebrew/extend/fileutils.rb @@ -83,21 +83,4 @@ def copy_metadata(path) end end end - - private - - # Run scons using a Homebrew-installed version, instead of whatever - # is in the user's PATH - def scons *args - system Formulary.factory("scons").opt_bin/"scons", *args - end - - def rake *args - system RUBY_BIN/'rake', *args - end - - alias_method :old_ruby, :ruby if method_defined?(:ruby) - def ruby *args - system RUBY_PATH, *args - end end diff --git a/lib/homebrew-fork/Library/Homebrew/hardware.rb b/lib/homebrew-fork/Library/Homebrew/hardware.rb index ae831ab167b09..ab620d9427974 100644 --- a/lib/homebrew-fork/Library/Homebrew/hardware.rb +++ b/lib/homebrew-fork/Library/Homebrew/hardware.rb @@ -40,26 +40,4 @@ def ppc? require 'os/mac/hardware' CPU.extend MacCPUs - - def self.cores_as_words - case Hardware::CPU.cores - when 1 then 'single' - when 2 then 'dual' - when 4 then 'quad' - else - Hardware::CPU.cores - end - end - - def self.oldest_cpu - if Hardware::CPU.intel? - if Hardware::CPU.is_64_bit? - :core2 - else - :core - end - else - Hardware::CPU.family - end - end end diff --git a/lib/homebrew-fork/Library/Homebrew/utils.rb b/lib/homebrew-fork/Library/Homebrew/utils.rb index 9a9a3aabf6aae..dcb2e1e4e668e 100644 --- a/lib/homebrew-fork/Library/Homebrew/utils.rb +++ b/lib/homebrew-fork/Library/Homebrew/utils.rb @@ -49,11 +49,6 @@ def ohai title, *sput puts sput end -def oh1 title - title = Tty.truncate(title) if $stdout.tty? && !ARGV.verbose? - puts "#{Tty.green}==>#{Tty.white} #{title}#{Tty.reset}" -end - def opoo warning $stderr.puts "#{Tty.red}Warning#{Tty.reset}: #{warning}" end @@ -62,46 +57,8 @@ def onoe error $stderr.puts "#{Tty.red}Error#{Tty.reset}: #{error}" end -def ofail error - onoe error - Homebrew.failed = true -end - -def odie error - onoe error - exit 1 -end - # :stopdoc: -def pretty_duration s - return "2 seconds" if s < 3 # avoids the plural problem ;) - return "#{s.to_i} seconds" if s < 120 - return "%.1f minutes" % (s/60) -end - -def plural n, s="s" - (n == 1) ? "" : s -end - -def interactive_shell f=nil - unless f.nil? - ENV['HOMEBREW_DEBUG_PREFIX'] = f.prefix - ENV['HOMEBREW_DEBUG_INSTALL'] = f.name - end - - Process.wait fork { exec ENV['SHELL'] } - - if $?.success? - return - elsif $?.exited? - puts "Aborting due to non-zero exit status" - exit $?.exitstatus - else - raise $?.inspect - end -end - module Homebrew def self.system cmd, *args puts "#{cmd} #{args*' '}" if ARGV.verbose? @@ -114,10 +71,6 @@ def self.system cmd, *args Process.wait(pid) $?.success? end - - def self.git_head - HOMEBREW_REPOSITORY.cd { `git rev-parse --verify -q HEAD 2>/dev/null`.chuzzle } - end end def with_system_path @@ -207,11 +160,6 @@ def exec_editor *args safe_exec(which_editor, *args) end -def exec_browser *args - browser = ENV['HOMEBREW_BROWSER'] || ENV['BROWSER'] || '/usr/bin/open' - safe_exec(browser, *args) -end - def safe_exec cmd, *args # This buys us proper argument quoting and evaluation # of environment variables in the cmd parameter. @@ -226,12 +174,6 @@ def gzip *paths end end -# Returns array of architectures that the given command or library is built for. -def archs_for_command cmd - cmd = which(cmd) unless Pathname.new(cmd).absolute? - Pathname.new(cmd).archs -end - def ignore_interrupts(opt = nil) std_trap = trap("INT") do puts "One sec, just cleaning up" unless opt == :quietly @@ -241,21 +183,6 @@ def ignore_interrupts(opt = nil) trap("INT", std_trap) end -def nostdout - if ARGV.verbose? - yield - else - begin - out = $stdout.dup - $stdout.reopen("/dev/null") - yield - ensure - $stdout.reopen(out) - out.close - end - end -end - def paths @paths ||= ENV['PATH'].split(File::PATH_SEPARATOR).collect do |p| begin