aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorAdam Vandenberg2011-12-18 09:57:15 -0800
committerAdam Vandenberg2011-12-18 16:24:56 -0800
commite65649aeb045bbc4529513b989a909cc13fed358 (patch)
treef8f04f532f3cb263650a7227accc5ecf7cb6bb5b /Library/Homebrew
parenta68152fc7de5c12f5157fff4eca1252ee5bc9669 (diff)
downloadbrew-e65649aeb045bbc4529513b989a909cc13fed358.tar.bz2
--HEAD checks
* Force --HEAD for head-only installs * Don't allow --HEAD for stable-only formulae
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/install.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index a7b3dc0f9..735db6107 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -88,6 +88,16 @@ module Homebrew extend self
# command line may have been installed to satisfy a dependency.
next if f.installed? unless ARGV.force?
+ # Building head-only without --HEAD is an error
+ if not ARGV.build_head? and f.stable.nil?
+ raise "This is a head-only formula; install with `brew install --HEAD #{f.name}`"
+ end
+
+ # Building stable-only with --HEAD is an error
+ if ARGV.build_head? and f.unstable.nil?
+ raise "No head is defined for #{f.name}"
+ end
+
begin
fi = FormulaInstaller.new(f)
fi.install