Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove numerous unused methods from homebrew-fork #8332

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions lib/homebrew-fork/Library/Homebrew/extend/fileutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 0 additions & 22 deletions lib/homebrew-fork/Library/Homebrew/hardware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
73 changes: 0 additions & 73 deletions lib/homebrew-fork/Library/Homebrew/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand Down