aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-03-10 14:56:02 -0500
committerJack Nagel2014-03-10 14:56:02 -0500
commit4cc1954e1496acf5f2db70134f7695d45e5ffc07 (patch)
tree08f491c2da0d89a4cb8d68429971ba47d087da17 /Library
parent3f1f612bf1a680e9d7d73dd258f71becfcd416c3 (diff)
downloadhomebrew-4cc1954e1496acf5f2db70134f7695d45e5ffc07.tar.bz2
Update bottle command for generalized bottle implementation
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/bottle.rb31
-rw-r--r--Library/Homebrew/cmd/versions.rb4
2 files changed, 15 insertions, 20 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb
index 5d09164e2..91cac596f 100644
--- a/Library/Homebrew/cmd/bottle.rb
+++ b/Library/Homebrew/cmd/bottle.rb
@@ -7,14 +7,6 @@ require 'utils/inreplace'
require 'erb'
require 'extend/pathname'
-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'
- def self.reset_bottle; @bottle = Bottle.new; end
-end
-
BOTTLE_ERB = <<-EOS
bottle do
<% if prefix.to_s != "/usr/local" %>
@@ -119,7 +111,12 @@ module Homebrew extend self
bottle_revision = max ? max + 1 : 0
end
- filename = bottle_filename(f, :tag => bottle_tag, :revision => bottle_revision)
+ filename = bottle_filename(
+ :name => f.name,
+ :version => f.pkg_version,
+ :revision => bottle_revision,
+ :tag => bottle_tag
+ )
if bottle_filename_formula_name(filename).empty?
return ofail "Add a new regex to bottle_version.rb to parse #{f.version} from #{filename}"
@@ -170,7 +167,7 @@ module Homebrew extend self
end
end
- bottle = Bottle.new
+ bottle = BottleSpecification.new
bottle.prefix HOMEBREW_PREFIX
bottle.cellar relocatable ? :any : HOMEBREW_CELLAR
bottle.revision bottle_revision
@@ -197,15 +194,13 @@ module Homebrew extend self
bottle_block = IO.read argument
merge_hash[formula_name] << bottle_block
end
- merge_hash.keys.each do |formula_name|
- BottleMerger.reset_bottle
+
+ merge_hash.each do |formula_name, bottle_blocks|
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
- next unless bottle
+
+ bottle = BottleSpecification.new
+ bottle_blocks.each { |block| bottle.instance_eval(block) }
+
output = bottle_output bottle
puts output
diff --git a/Library/Homebrew/cmd/versions.rb b/Library/Homebrew/cmd/versions.rb
index 4112c8d39..fa38cfca6 100644
--- a/Library/Homebrew/cmd/versions.rb
+++ b/Library/Homebrew/cmd/versions.rb
@@ -45,9 +45,9 @@ class Formula
map = Hash.new { |h, k| h[k] = [] }
rev_list(branch) do |rev|
formula_for_sha(rev) do |f|
- bottle = f.class.bottle
+ bottle = f.stable.bottle_specification
unless bottle.checksums.empty?
- map[bottle.version] << bottle.revision
+ map[f.pkg_version] << bottle.revision
end
end
end