bottle: use versions to access previous bottles.

This commit is contained in:
Mike McQuaid 2013-09-21 15:16:45 +01:00
parent c883286840
commit 19618bddd4

View File

@ -2,6 +2,7 @@ require 'formula'
require 'bottles' require 'bottles'
require 'tab' require 'tab'
require 'keg' require 'keg'
require 'cmd/versions'
class BottleMerger < Formula class BottleMerger < Formula
# This provides a URL and Version which are the only needed properties of # This provides a URL and Version which are the only needed properties of
@ -50,8 +51,12 @@ module Homebrew extend self
return ofail "Formula not installed with '--build-bottle': #{f.name}" return ofail "Formula not installed with '--build-bottle': #{f.name}"
end end
bottle_revision = bottle_new_revision f master_bottle_filenames = f.bottle_filenames 'origin/master'
filename = bottle_filename f, bottle_revision bottle_revision = -1
begin
bottle_revision += 1
filename = bottle_filename(f, bottle_revision)
end while master_bottle_filenames.include? filename
if bottle_filename_formula_name(filename).empty? if bottle_filename_formula_name(filename).empty?
return ofail "Add a new regex to bottle_version.rb to parse the bottle filename." return ofail "Add a new regex to bottle_version.rb to parse the bottle filename."