bottle: discard bottle revision from prior pkg_version

Closes Homebrew/homebrew#38628.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Ian Lancaster 2015-04-13 12:57:03 -04:00 committed by Xu Cheng
parent cd63b740a5
commit c327fdafa9

View File

@ -130,8 +130,9 @@ module Homebrew
else
ohai "Determining #{f.name} bottle revision..."
versions = FormulaVersions.new(f)
max = versions.bottle_version_map("origin/master")[f.pkg_version].max
bottle_revision = max ? max + 1 : 0
bottle_revisions = versions.bottle_version_map("origin/master")[f.pkg_version]
bottle_revisions.pop if bottle_revisions.last > 0
bottle_revision = bottle_revisions.any? ? bottle_revisions.max + 1 : 0
end
filename = Bottle::Filename.create(f, bottle_tag, bottle_revision)