aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/bottles.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/bottles.rb')
-rw-r--r--Library/Homebrew/bottles.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb
index e20ffdf8e..0ea0e9c65 100644
--- a/Library/Homebrew/bottles.rb
+++ b/Library/Homebrew/bottles.rb
@@ -3,11 +3,11 @@ require 'os/mac'
require 'extend/ARGV'
require 'bottle_version'
-def bottle_filename f, bottle_revision=nil
+def bottle_filename f, options={:tag=>bottle_tag, :bottle_revision=>nil}
name = f.name.downcase
version = f.stable.version
bottle_revision ||= f.bottle.revision.to_i if f.bottle
- "#{name}-#{version}#{bottle_native_suffix(bottle_revision)}"
+ "#{name}-#{version}#{bottle_native_suffix(options)}"
end
def install_bottle? f, options={:warn=>false}
@@ -48,8 +48,8 @@ def bottle_file_outdated? f, file
bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext
end
-def bottle_native_suffix revision=nil
- ".#{bottle_tag}#{bottle_suffix(revision)}"
+def bottle_native_suffix options={:tag=>bottle_tag}
+ ".#{options[:tag]}#{bottle_suffix(options[:revision])}"
end
def bottle_suffix revision=nil
@@ -70,8 +70,8 @@ def bottle_root_url f
root_url ||= 'https://downloads.sf.net/project/machomebrew/Bottles'
end
-def bottle_url f
- "#{bottle_root_url(f)}/#{bottle_filename(f)}"
+def bottle_url f, tag=bottle_tag
+ "#{bottle_root_url(f)}/#{bottle_filename(f, {:tag => tag})}"
end
def bottle_tag
@@ -109,9 +109,12 @@ class BottleCollector
def fetch_bottle_for(tag)
return [@bottles[tag], tag] if @bottles[tag]
- find_altivec_tag(tag) || find_or_later(tag)
+ find_altivec_tag(tag) || find_or_later_tag(tag)
end
+ def keys; @bottles.keys; end
+ def [](arg); @bottles[arg]; end
+
# This allows generic Altivec PPC bottles to be supported in some
# formulae, while also allowing specific bottles in others; e.g.,
# sometimes a formula has just :tiger_altivec, other times it has