aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2013-06-08 16:48:43 +0100
committerMike McQuaid2013-06-08 16:48:43 +0100
commit3a217e6febb8ebdbb9a6f0fdb9ba1860128c9373 (patch)
tree76af32478be78ad2774bfdc2f56e105f577073e4 /Library
parenteb198549032721923bf087d55ea289c9dd8b1c1a (diff)
downloadhomebrew-3a217e6febb8ebdbb9a6f0fdb9ba1860128c9373.tar.bz2
brew-bottle: merge arg for bottle metadata files.
Closes #20266.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/bottle.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb
index 4f817b82e..83dd729c7 100644
--- a/Library/Homebrew/cmd/bottle.rb
+++ b/Library/Homebrew/cmd/bottle.rb
@@ -3,6 +3,13 @@ require 'bottles'
require 'tab'
require 'keg'
+class BottleMerger < Formula
+ # This provides a URL and Version which are the only needed properties of
+ # a Formula. This object is used to access the Formula bottle DSL to merge
+ # multiple outputs of `brew bottle`.
+ url '1'
+end
+
module Homebrew extend self
def keg_contains string, keg
quiet_system 'fgrep', '--recursive', '--quiet', '--max-count=1', string, keg
@@ -79,7 +86,17 @@ module Homebrew extend self
end
def bottle
- ARGV.formulae.each do|f|
+ if ARGV.include? '--merge'
+ ARGV.named.each do |argument|
+ bottle_block = IO.read(argument)
+ BottleMerger.class_eval bottle_block
+ end
+ bottle = BottleMerger.new.bottle
+ bottle_output bottle if bottle
+ exit 0
+ end
+
+ ARGV.formulae.each do |f|
bottle_formula Formula.factory f
end
end