tab: eliminate redundant 'Tab.create' arguments (#468)
The `build` and `source_modified_time` arguments are always coming from the matching attributes of the `Formula` instance. Thus query `formula` for them instead of passing them individually.
This commit is contained in:
parent
86b1df96b9
commit
bf40dd64df
@ -131,7 +131,8 @@ class Build
|
|||||||
formula.install
|
formula.install
|
||||||
|
|
||||||
stdlibs = detect_stdlibs(ENV.compiler)
|
stdlibs = detect_stdlibs(ENV.compiler)
|
||||||
Tab.create(formula, ENV.compiler, stdlibs.first, formula.build, formula.source_modified_time).write
|
tab = Tab.create(formula, ENV.compiler, stdlibs.first)
|
||||||
|
tab.write
|
||||||
|
|
||||||
# Find and link metafiles
|
# Find and link metafiles
|
||||||
formula.prefix.install_metafiles formula.buildpath
|
formula.prefix.install_metafiles formula.buildpath
|
||||||
|
@ -15,7 +15,8 @@ class Tab < OpenStruct
|
|||||||
CACHE.clear
|
CACHE.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.create(formula, compiler, stdlib, build, source_modified_time)
|
def self.create(formula, compiler, stdlib)
|
||||||
|
build = formula.build
|
||||||
attributes = {
|
attributes = {
|
||||||
"used_options" => build.used_options.as_flags,
|
"used_options" => build.used_options.as_flags,
|
||||||
"unused_options" => build.unused_options.as_flags,
|
"unused_options" => build.unused_options.as_flags,
|
||||||
@ -23,7 +24,7 @@ class Tab < OpenStruct
|
|||||||
"built_as_bottle" => build.bottle?,
|
"built_as_bottle" => build.bottle?,
|
||||||
"poured_from_bottle" => false,
|
"poured_from_bottle" => false,
|
||||||
"time" => Time.now.to_i,
|
"time" => Time.now.to_i,
|
||||||
"source_modified_time" => source_modified_time.to_i,
|
"source_modified_time" => formula.source_modified_time.to_i,
|
||||||
"HEAD" => HOMEBREW_REPOSITORY.git_head,
|
"HEAD" => HOMEBREW_REPOSITORY.git_head,
|
||||||
"compiler" => compiler,
|
"compiler" => compiler,
|
||||||
"stdlib" => stdlib,
|
"stdlib" => stdlib,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user