aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2011-03-15 22:01:27 -0700
committerAdam Vandenberg2011-03-15 22:03:23 -0700
commit9eb7c1995ff582db08a918a887e59e7de06de532 (patch)
treed4184fd4cce92736d2f3d7be7f370fb7c679da55 /Library
parentd600846059a8f004f3dd880f3c6ff754545c05c1 (diff)
downloadhomebrew-9eb7c1995ff582db08a918a887e59e7de06de532.tar.bz2
keg-only: provide more info about system dupes
System duplicates can now provide more information about why they are included in Homebrew.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb31
1 files changed, 28 insertions, 3 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 3de1935d8..868aebfc5 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -1,7 +1,7 @@
require 'download_strategy'
require 'fileutils'
-
+# Defines a URL and download method for a stable or HEAD build
class SoftwareSpecification
attr_reader :url, :specs, :using
@@ -46,6 +46,31 @@ class SoftwareSpecification
end
+# Used to annotate formulae that duplicate OS X provided software
+# :provided_by_osx
+class KegOnlyReason
+ attr_reader :reason, :explanation
+
+ def initialize reason, explanation=nil
+ @reason = reason
+ @explanation = explanation
+ end
+
+ def to_s
+ if @reason == :provided_by_osx
+ <<-EOS.chomp
+Mac OS X already provides this program and installing another version in
+parallel can cause all kinds of trouble.
+
+#{@explanation}
+EOS
+ else
+ @reason
+ end
+ end
+end
+
+
# Derive and define at least @url, see Library/Formula for examples
class Formula
include FileUtils
@@ -648,8 +673,8 @@ EOF
puts "detected as an alias for the target formula."
end
- def keg_only reason
- @keg_only_reason = reason
+ def keg_only reason, explanation=nil
+ @keg_only_reason = KegOnlyReason.new(reason, explanation.chomp)
end
end
end