Only consider latest rebuild
This commit is contained in:
parent
4f4fb49481
commit
056c9bb37f
@ -334,9 +334,8 @@ module Homebrew
|
||||
else
|
||||
ohai "Determining #{f.full_name} bottle rebuild..."
|
||||
versions = FormulaVersions.new(f)
|
||||
rebuilds = versions.bottle_version_map("origin/master")[f.pkg_version]
|
||||
rebuilds.pop if rebuilds.last.to_i.positive?
|
||||
rebuilds.empty? ? 0 : rebuilds.max.to_i + 1
|
||||
rebuilds = versions.most_recent_rebuild_for_pkg_version("origin/master", f.pkg_version)
|
||||
rebuilds ? rebuilds.to_i + 1 : 0
|
||||
end
|
||||
|
||||
filename = Bottle::Filename.create(f, bottle_tag.to_sym, rebuild)
|
||||
|
||||
@ -30,7 +30,8 @@ class FormulaVersions
|
||||
|
||||
def rev_list(branch)
|
||||
repository.cd do
|
||||
Utils.popen_read("git", "rev-list", "--abbrev-commit", "--remove-empty", branch, "--", entry_name) do |io|
|
||||
Utils.popen_read("git", "rev-list", "--abbrev-commit", "--remove-empty", "--first-parent", branch, "--",
|
||||
entry_name) do |io|
|
||||
yield io.readline.chomp until io.eof?
|
||||
end
|
||||
end
|
||||
@ -57,21 +58,21 @@ class FormulaVersions
|
||||
Homebrew.raise_deprecation_exceptions = false
|
||||
end
|
||||
|
||||
def bottle_version_map(branch)
|
||||
map = Hash.new { |h, k| h[k] = [] }
|
||||
|
||||
versions_seen = 0
|
||||
def most_recent_rebuild_for_pkg_version(branch, pkg_version)
|
||||
rev_list(branch) do |rev|
|
||||
formula_at_revision(rev) do |f|
|
||||
odebug "Considering #{rev}. #{f.pkg_version} (rebuild: #{f.bottle_specification.rebuild}"
|
||||
bottle = f.bottle_specification
|
||||
map[f.pkg_version] << bottle.rebuild unless bottle.checksums.empty?
|
||||
versions_seen = (map.keys + [f.pkg_version]).uniq.length
|
||||
# If the version is older than the one we want, we've gone too far
|
||||
return if f.pkg_version < pkg_version
|
||||
|
||||
# If this revision has a rebuild number, we are done!
|
||||
return bottle.rebuild if f.pkg_version == pkg_version && !bottle.checksums.empty?
|
||||
end
|
||||
return map if versions_seen > MAX_VERSIONS_DEPTH
|
||||
rescue MacOSVersionError => e
|
||||
odebug "#{e} in #{name} at revision #{rev}"
|
||||
break
|
||||
end
|
||||
map
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user