From acadadff42a30012fe59046ae6486041d695e62c Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Mon, 12 Jan 2015 23:03:38 +0000 Subject: install: handle devel-only correctly See the discussion in https://github.com/Homebrew/homebrew-devel-only/pull/6 Closes #35793. Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/install.rb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'Library/Homebrew/cmd/install.rb') diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 8ac532a97..14bf24b50 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -40,20 +40,32 @@ module Homebrew end ARGV.formulae.each do |f| - # Building head-only without --HEAD is an error - if not ARGV.build_head? and f.stable.nil? + # head-only without --HEAD is an error + if not ARGV.build_head? and f.stable.nil? and f.devel.nil? raise <<-EOS.undent #{f.name} is a head-only formula Install with `brew install --HEAD #{f.name}` EOS end - # Building stable-only with --HEAD is an error + # devel-only without --devel is an error + if not ARGV.build_devel? and f.stable.nil? + if f.head.nil? + raise <<-EOS.undent + #{f.name} is a devel-only formula + Install with `brew install --devel #{f.name}` + EOS + else + raise "#{f.name} has no stable download, please choose --devel or --HEAD" + end + end + + # --HEAD, fail with no head defined if ARGV.build_head? and f.head.nil? raise "No head is defined for #{f.name}" end - # Building stable-only with --devel is an error + # --devel, fail with no devel defined if ARGV.build_devel? and f.devel.nil? raise "No devel block is defined for #{f.name}" end -- cgit v1.2.3