aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/install.rb
diff options
context:
space:
mode:
authorDominyk Tiller2015-01-12 23:03:38 +0000
committerJack Nagel2015-01-15 23:50:45 -0500
commitacadadff42a30012fe59046ae6486041d695e62c (patch)
treecea8ef4623fe57c647f121102ae71c1f441ce8c5 /Library/Homebrew/cmd/install.rb
parent4d13fef1b1de6755cc72876cbfb4dec8f293c8f6 (diff)
downloadhomebrew-acadadff42a30012fe59046ae6486041d695e62c.tar.bz2
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 <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/cmd/install.rb')
-rw-r--r--Library/Homebrew/cmd/install.rb20
1 files changed, 16 insertions, 4 deletions
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