diff options
| author | Dominyk Tiller | 2015-01-12 23:03:38 +0000 |
|---|---|---|
| committer | Jack Nagel | 2015-01-15 23:50:45 -0500 |
| commit | 3f318b8ed4f33fa1f27f5ce1816ca72513196208 (patch) | |
| tree | 6218b2302cbe0e5ca9c0ea21e02660b382266a67 /Library/Homebrew | |
| parent | 3613f0349ee56084f40a1367a496cff5ea8da328 (diff) | |
| download | brew-3f318b8ed4f33fa1f27f5ce1816ca72513196208.tar.bz2 | |
install: handle devel-only correctly
See the discussion in
https://github.com/Homebrew/homebrew-devel-only/pull/6
Closes Homebrew/homebrew#35793.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 20 |
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 |
