aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/formula.rb9
-rw-r--r--Library/Homebrew/tab.rb14
2 files changed, 18 insertions, 5 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 9dcc3b860..77ed32c48 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -362,6 +362,15 @@ class Formula
raise FormulaUnavailableError.new(name)
end
+ def tap
+ if path.realpath.to_s =~ %r{#{HOMEBREW_REPOSITORY}/Library/Taps/(\w+)-(\w+)}
+ "#$1/#$2"
+ else
+ # remotely installed formula are not mxcl/master but this will do for now
+ "mxcl/master"
+ end
+ end
+
def self.path name
HOMEBREW_REPOSITORY+"Library/Formula/#{name.downcase}.rb"
end
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index c22998dc3..78e1bdab5 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -17,8 +17,9 @@ class Tab < OpenStruct
Tab.new :used_options => formula_options & arg_options,
:unused_options => formula_options - arg_options,
- :tabfile => f.prefix + 'INSTALL_RECEIPT.json',
- :built_bottle => !!args.build_bottle?
+ :tabfile => f.prefix + "INSTALL_RECEIPT.json",
+ :built_bottle => !!args.build_bottle?,
+ :tapped_from => f.tap
end
def self.from_file path
@@ -39,7 +40,8 @@ class Tab < OpenStruct
rescue FormulaUnavailableError
Tab.new :used_options => [],
:unused_options => [],
- :built_bottle => false
+ :built_bottle => false,
+ :tapped_from => ""
end
end
end
@@ -66,7 +68,8 @@ class Tab < OpenStruct
def self.dummy_tab f
Tab.new :used_options => [],
:unused_options => f.options.map { |o, _| o},
- :built_bottle => false
+ :built_bottle => false,
+ :tapped_from => ""
end
def installed_with? opt
@@ -81,7 +84,8 @@ class Tab < OpenStruct
MultiJson.encode({
:used_options => used_options,
:unused_options => unused_options,
- :built_bottle => built_bottle
+ :built_bottle => built_bottle,
+ :tapped_from => tapped_from
})
end