From bdf245ff98e2c3498528d3f5f9ebb128fad5d700 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sun, 18 Jul 2010 10:38:45 -0700 Subject: [PATCH] Add keg-only to DSL --- Library/Homebrew/formula.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index e39dfa8b8c..81b139e8e9 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -163,7 +163,9 @@ class Formula # rarely, you don't want your library symlinked into the main prefix # see gettext.rb for an example - def keg_only?; false end + def keg_only? + self.class.keg_only_reason || false + end # sometimes the clean process breaks things # skip cleaning paths in a formula with a class method like this: @@ -477,7 +479,7 @@ EOF end end - attr_rw :version, :homepage, :specs, :deps, :external_deps + attr_rw :version, :homepage, :specs, :deps, :external_deps, :keg_only_reason attr_rw *CHECKSUM_TYPES def head val=nil, specs=nil @@ -538,6 +540,10 @@ EOF puts "Aliases to Formula. The name of the symlink will be" puts "detected as an alias for the target formula." end + + def keg_only reason + @keg_only_reason = reason + end end end