aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/bottle.rb
diff options
context:
space:
mode:
authorMike McQuaid2013-09-21 15:16:16 +0100
committerMike McQuaid2013-09-21 15:18:48 +0100
commitd752db519f5de201a947b40b2323dd41ea2dbd63 (patch)
treea8c39a9ad50a2c99475bf659a63c403bbe2850b1 /Library/Homebrew/cmd/bottle.rb
parent25a51853be36271afe0ae48668e3857456956c7b (diff)
downloadhomebrew-d752db519f5de201a947b40b2323dd41ea2dbd63.tar.bz2
bottle: fix --merge with multiple formulae.
Diffstat (limited to 'Library/Homebrew/cmd/bottle.rb')
-rw-r--r--Library/Homebrew/cmd/bottle.rb24
1 files changed, 19 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb
index ac1fecd3c..584e8f215 100644
--- a/Library/Homebrew/cmd/bottle.rb
+++ b/Library/Homebrew/cmd/bottle.rb
@@ -8,6 +8,7 @@ class BottleMerger < Formula
# a Formula. This object is used to access the Formula bottle DSL to merge
# multiple outputs of `brew bottle`.
url '1'
+ def self.reset_bottle; @bottle = Bottle.new; end
end
module Homebrew extend self
@@ -104,16 +105,29 @@ module Homebrew extend self
end
end
- def bottle
- if ARGV.include? '--merge'
- ARGV.named.each do |argument|
- bottle_block = IO.read(argument)
+ def merge
+ merge_hash = {}
+ ARGV.named.each do |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
end
bottle = BottleMerger.new.bottle
bottle_output bottle if bottle
- exit 0
end
+ exit 0
+ end
+
+ def bottle
+ merge if ARGV.include? '--merge'
ARGV.formulae.each do |f|
bottle_formula f