Skip to content
Snippets Groups Projects
Commit 4b1028c9 authored by Jack Nagel's avatar Jack Nagel
Browse files

Start recording the formula path in the install receipt

Later we can use this information to try and load the formula from the
correct source.
parent 1ab384a3
No related branches found
No related tags found
No related merge requests found
......@@ -11,16 +11,23 @@ class Tab < OpenStruct
FILENAME = 'INSTALL_RECEIPT.json'
def self.create(formula, compiler, stdlib, build)
Tab.new :used_options => build.used_options.as_flags,
:unused_options => build.unused_options.as_flags,
:tabfile => formula.prefix.join(FILENAME),
:built_as_bottle => !!ARGV.build_bottle?,
:poured_from_bottle => false,
:tapped_from => formula.tap,
:time => Time.now.to_i,
:HEAD => Homebrew.git_head,
:compiler => compiler,
:stdlib => stdlib
attributes = {
:used_options => build.used_options.as_flags,
:unused_options => build.unused_options.as_flags,
:tabfile => formula.prefix.join(FILENAME),
:built_as_bottle => !!ARGV.build_bottle?,
:poured_from_bottle => false,
:tapped_from => formula.tap,
:time => Time.now.to_i,
:HEAD => Homebrew.git_head,
:compiler => compiler,
:stdlib => stdlib,
:source => {
:path => formula.path.to_s,
},
}
new(attributes)
end
def self.from_file path
......@@ -83,15 +90,22 @@ class Tab < OpenStruct
end
def self.dummy_tab f=nil
Tab.new :used_options => [],
:unused_options => (f.options.as_flags rescue []),
:built_as_bottle => false,
:poured_from_bottle => false,
:tapped_from => "",
:time => nil,
:HEAD => nil,
:stdlib => nil,
:compiler => :clang
attributes = {
:used_options => [],
:unused_options => (f.options.as_flags rescue []),
:built_as_bottle => false,
:poured_from_bottle => false,
:tapped_from => "",
:time => nil,
:HEAD => nil,
:stdlib => nil,
:compiler => :clang,
:source => {
:path => nil,
},
}
new(attributes)
end
def with? val
......@@ -139,7 +153,7 @@ class Tab < OpenStruct
end
def to_json
Utils::JSON.dump({
attributes = {
:used_options => used_options.as_flags,
:unused_options => unused_options.as_flags,
:built_as_bottle => built_as_bottle,
......@@ -148,7 +162,11 @@ class Tab < OpenStruct
:time => time,
:HEAD => self.HEAD,
:stdlib => (stdlib.to_s if stdlib),
:compiler => (compiler.to_s if compiler)})
:compiler => (compiler.to_s if compiler),
:source => source || {},
}
Utils::JSON.dump(attributes)
end
def write
......
......@@ -17,6 +17,7 @@ class TabTests < Homebrew::TestCase
:HEAD => TEST_SHA1,
:compiler => "clang",
:stdlib => "libcxx",
:source => { :path => nil },
})
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