aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMax Howell2012-03-16 12:29:47 +0000
committerMax Howell2012-03-16 21:06:17 +0000
commit598f7b69d961bb2a5b5067a511e8ab5875cbe8f3 (patch)
tree6b78112a22ea3dd362d8ffacf789cb00e6b64914 /Library/Homebrew
parent3d5b4af523dca55fe7fa49433eec2519254b060b (diff)
downloadbrew-598f7b69d961bb2a5b5067a511e8ab5875cbe8f3.tar.bz2
Record tap-origin in the install-receipt
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