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
commit4b355399789cd79009d42a05a742efc7954cf380 (patch)
tree2d7d7445a6f2d7d32ba24105dfa448158fdeca65 /Library
parent517889d6fb8a871f7f53f5b72da9bb6e4bbc9b10 (diff)
downloadbrew-4b355399789cd79009d42a05a742efc7954cf380.tar.bz2
brew-bottle: merge arg for bottle metadata files.
Closes Homebrew/homebrew#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