aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-07-16 18:54:19 -0500
committerJack Nagel2014-07-16 18:54:19 -0500
commit3c366a56d7af3e51daac0c530a8b43ab005f31d1 (patch)
treea07bb157702c8e058119cc843c032d1e591a03cb /Library
parent197dbe56011a656784e4c1dae734fabc3a3d512f (diff)
downloadbrew-3c366a56d7af3e51daac0c530a8b43ab005f31d1.tar.bz2
Add key? to BottleCollector
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/bottles.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb
index 413c615df..ee779cb3e 100644
--- a/Library/Homebrew/bottles.rb
+++ b/Library/Homebrew/bottles.rb
@@ -69,7 +69,7 @@ class BottleCollector
end
def fetch_checksum_for(tag)
- return [@bottles[tag], tag] if @bottles[tag]
+ return [@bottles[tag], tag] if key?(tag)
find_altivec_tag(tag) || find_or_later_tag(tag)
end
@@ -86,14 +86,18 @@ class BottleCollector
@bottles[key] = value
end
+ def key?(key)
+ @bottles.key?(key)
+ 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
# :tiger_g4, :tiger_g5, etc.
def find_altivec_tag(tag)
if tag.to_s =~ /(\w+)_(g4|g4e|g5)$/
- altitag = "#{$1}_altivec".to_sym
- return [@bottles[altitag], altitag] if @bottles[altitag]
+ altivec_tag = "#{$1}_altivec".to_sym
+ return [@bottles[altivec_tag], altivec_tag] if key?(altivec_tag)
end
end