aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorAdam Vandenberg2013-06-08 18:17:28 -0700
committerAdam Vandenberg2013-06-08 20:44:56 -0700
commit4b014a4ed10ede1fded752970db1531f21d314ab (patch)
tree31cf8ecd3e1bba5b0622385b314d0e906f3853df /Library/Homebrew/cmd
parentf65ae1fdf64c7dbd81258fa731f29416ebbb4078 (diff)
downloadhomebrew-4b014a4ed10ede1fded752970db1531f21d314ab.tar.bz2
Consolidate sudo checks.
Closes #20318.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/install.rb4
-rw-r--r--Library/Homebrew/cmd/link.rb4
-rw-r--r--Library/Homebrew/cmd/pin.rb3
-rw-r--r--Library/Homebrew/cmd/unpin.rb3
-rw-r--r--Library/Homebrew/cmd/upgrade.rb6
5 files changed, 0 insertions, 20 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index c0aa1a2e9..cbeb433eb 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -18,10 +18,6 @@ module Homebrew extend self
end
end unless ARGV.force?
- if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
- raise "Cowardly refusing to `sudo brew install'\n#{SUDO_BAD_ERRMSG}"
- end
-
install_formulae ARGV.formulae
end
diff --git a/Library/Homebrew/cmd/link.rb b/Library/Homebrew/cmd/link.rb
index 0184febaf..67ce43478 100644
--- a/Library/Homebrew/cmd/link.rb
+++ b/Library/Homebrew/cmd/link.rb
@@ -5,10 +5,6 @@ module Homebrew extend self
def link
raise KegUnspecifiedError if ARGV.named.empty?
- if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
- raise "Cowardly refusing to `sudo brew link'\n#{SUDO_BAD_ERRMSG}"
- end
-
mode = OpenStruct.new
mode.overwrite = true if ARGV.include? '--overwrite'
diff --git a/Library/Homebrew/cmd/pin.rb b/Library/Homebrew/cmd/pin.rb
index 2c0d5d33d..b8c1d1e33 100644
--- a/Library/Homebrew/cmd/pin.rb
+++ b/Library/Homebrew/cmd/pin.rb
@@ -2,9 +2,6 @@ require 'formula'
module Homebrew extend self
def pin
- if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
- abort "Cowardly refusing to `sudo pin'"
- end
raise FormulaUnspecifiedError if ARGV.named.empty?
ARGV.formulae.each do |f|
diff --git a/Library/Homebrew/cmd/unpin.rb b/Library/Homebrew/cmd/unpin.rb
index 265f7a941..4da280eef 100644
--- a/Library/Homebrew/cmd/unpin.rb
+++ b/Library/Homebrew/cmd/unpin.rb
@@ -2,9 +2,6 @@ require 'formula'
module Homebrew extend self
def unpin
- if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
- abort "Cowardly refusing to `sudo unpin'"
- end
raise FormulaUnspecifiedError if ARGV.named.empty?
ARGV.formulae.each do |f|
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index fe41a1507..28882360b 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -8,12 +8,6 @@ end
module Homebrew extend self
def upgrade
- if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
- # note we only abort if Homebrew is *not* installed as sudo and the user
- # calls brew as root. The fix is to chown brew to root.
- abort "Cowardly refusing to `sudo brew upgrade'"
- end
-
Homebrew.perform_preinstall_checks
if ARGV.named.empty?