aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-06-16 13:38:14 -0500
committerJack Nagel2014-06-16 18:39:59 -0500
commitc6d75bfcec5b953a3c2ded37212b545304f4e35c (patch)
tree9a53303795736b8979ad551919b927317f4330d8 /Library
parent9d030f83970f90d841494f0faf897e828e1ca33d (diff)
downloadbrew-c6d75bfcec5b953a3c2ded37212b545304f4e35c.tar.bz2
Move head-only checks to cmd/install
Fixes Homebrew/homebrew#30084. Closes Homebrew/homebrew#30203.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/install.rb15
-rw-r--r--Library/Homebrew/formula_installer.rb13
2 files changed, 15 insertions, 13 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index d975f485c..ca228e338 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -24,6 +24,21 @@ module Homebrew extend self
end
end unless ARGV.force?
+ ARGV.formulae.each do |f|
+ # Building head-only without --HEAD is an error
+ if not ARGV.build_head? and f.stable.nil?
+ raise CannotInstallFormulaError, <<-EOS.undent
+ #{f} is a head-only formula
+ Install with `brew install --HEAD #{f.name}`
+ EOS
+ end
+
+ # Building stable-only with --HEAD is an error
+ if ARGV.build_head? and f.head.nil?
+ raise CannotInstallFormulaError, "No head is defined for #{f.name}"
+ end
+ end
+
perform_preinstall_checks
begin
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 7321f9c4d..ea853be29 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -109,19 +109,6 @@ class FormulaInstaller
raise FormulaAlreadyInstalledError, msg
end
- # Building head-only without --HEAD is an error
- if not ARGV.build_head? and f.stable.nil?
- raise CannotInstallFormulaError, <<-EOS.undent
- #{f} is a head-only formula
- Install with `brew install --HEAD #{f.name}
- EOS
- end
-
- # Building stable-only with --HEAD is an error
- if ARGV.build_head? and f.head.nil?
- raise CannotInstallFormulaError, "No head is defined for #{f.name}"
- end
-
unless ignore_deps?
unlinked_deps = f.recursive_dependencies.map(&:to_formula).select do |dep|
dep.installed? and not dep.keg_only? and not dep.linked_keg.directory?