aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2013-09-21 15:16:16 +0100
committerMike McQuaid2013-09-21 15:18:48 +0100
commit36f36174942fa37f5dbf64e46679d33a600a1157 (patch)
tree5d2eee9e8f69235cf3d75df3b41758ada0e9ca41 /Library
parent5d3d385a656d55166775b1ec66e68ec72b2a46dd (diff)
downloadbrew-36f36174942fa37f5dbf64e46679d33a600a1157.tar.bz2
bottle: fix --merge with multiple formulae.
Diffstat (limited to 'Library')
-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