utils/bottles: fix outdated bottle check
This commit is contained in:
parent
02a0ea8449
commit
bb0252875e
@ -340,7 +340,7 @@ class Bottle
|
|||||||
|
|
||||||
extend Forwardable
|
extend Forwardable
|
||||||
|
|
||||||
attr_reader :name, :resource, :cellar, :rebuild
|
attr_reader :name, :resource, :tag, :cellar, :rebuild
|
||||||
|
|
||||||
def_delegators :resource, :url, :verify_download_integrity
|
def_delegators :resource, :url, :verify_download_integrity
|
||||||
def_delegators :resource, :cached_download
|
def_delegators :resource, :cached_download
|
||||||
|
|||||||
@ -33,16 +33,15 @@ module Utils
|
|||||||
end
|
end
|
||||||
|
|
||||||
def file_outdated?(formula, file)
|
def file_outdated?(formula, file)
|
||||||
|
file = file.resolved_path
|
||||||
|
|
||||||
filename = file.basename.to_s
|
filename = file.basename.to_s
|
||||||
return false if formula.bottle.blank?
|
return false if formula.bottle.blank?
|
||||||
|
|
||||||
bottle_ext, bottle_tag, = extname_tag_rebuild(filename)
|
_, bottle_tag, bottle_rebuild = extname_tag_rebuild(filename)
|
||||||
return false if bottle_ext.blank?
|
return false if bottle_tag.blank?
|
||||||
return false if bottle_tag != tag.to_s
|
|
||||||
|
|
||||||
bottle_url_ext, = extname_tag_rebuild(formula.bottle.url)
|
bottle_tag != formula.bottle.tag.to_s || bottle_rebuild.to_i != formula.bottle.rebuild
|
||||||
|
|
||||||
bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def extname_tag_rebuild(filename)
|
def extname_tag_rebuild(filename)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user