From c6d75bfcec5b953a3c2ded37212b545304f4e35c Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 16 Jun 2014 13:38:14 -0500 Subject: Move head-only checks to cmd/install Fixes Homebrew/homebrew#30084. Closes Homebrew/homebrew#30203. --- Library/Homebrew/cmd/install.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Library/Homebrew/cmd') 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 -- cgit v1.2.3