bottle: fix --merge with multiple formulae.
This commit is contained in:
parent
5d3d385a65
commit
36f3617494
@ -8,6 +8,7 @@ class BottleMerger < Formula
|
|||||||
# a Formula. This object is used to access the Formula bottle DSL to merge
|
# a Formula. This object is used to access the Formula bottle DSL to merge
|
||||||
# multiple outputs of `brew bottle`.
|
# multiple outputs of `brew bottle`.
|
||||||
url '1'
|
url '1'
|
||||||
|
def self.reset_bottle; @bottle = Bottle.new; end
|
||||||
end
|
end
|
||||||
|
|
||||||
module Homebrew extend self
|
module Homebrew extend self
|
||||||
@ -104,17 +105,30 @@ module Homebrew extend self
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def bottle
|
def merge
|
||||||
if ARGV.include? '--merge'
|
merge_hash = {}
|
||||||
ARGV.named.each do |argument|
|
ARGV.named.each do |argument|
|
||||||
bottle_block = IO.read(argument)
|
formula_name = bottle_filename_formula_name argument
|
||||||
|
merge_hash[formula_name] ||= []
|
||||||
|
bottle_block = IO.read argument
|
||||||
|
merge_hash[formula_name] << bottle_block
|
||||||
|
end
|
||||||
|
merge_hash.keys.each do |formula_name|
|
||||||
|
BottleMerger.reset_bottle
|
||||||
|
ohai formula_name
|
||||||
|
bottle_blocks = merge_hash[formula_name]
|
||||||
|
bottle_blocks.each do |bottle_block|
|
||||||
BottleMerger.class_eval bottle_block
|
BottleMerger.class_eval bottle_block
|
||||||
end
|
end
|
||||||
bottle = BottleMerger.new.bottle
|
bottle = BottleMerger.new.bottle
|
||||||
bottle_output bottle if bottle
|
bottle_output bottle if bottle
|
||||||
|
end
|
||||||
exit 0
|
exit 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def bottle
|
||||||
|
merge if ARGV.include? '--merge'
|
||||||
|
|
||||||
ARGV.formulae.each do |f|
|
ARGV.formulae.each do |f|
|
||||||
bottle_formula f
|
bottle_formula f
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user