Skip to content
Snippets Groups Projects
Commit 63846c7a authored by Adam Vandenberg's avatar Adam Vandenberg
Browse files

keg-only: provide more info about system dupes

System duplicates can now provide more information about why
they are included in Homebrew.
parent 9995f9a6
No related branches found
No related tags found
No related merge requests found
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment