aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/bottles.rb
diff options
context:
space:
mode:
authorMike McQuaid2012-04-03 11:43:41 -0500
committerMike McQuaid2012-04-03 11:43:41 +1000
commita947064994f020276b16007ebc9aa04af91189c3 (patch)
tree9a006ba39132966fa23f6a792c6da9fada224286 /Library/Homebrew/bottles.rb
parentbb8fcc89014de64d5faf7e8ac9a252144addb508 (diff)
downloadbrew-a947064994f020276b16007ebc9aa04af91189c3.tar.bz2
Version bottles.
Diffstat (limited to 'Library/Homebrew/bottles.rb')
-rw-r--r--Library/Homebrew/bottles.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb
index 35d93c2a5..4f6841934 100644
--- a/Library/Homebrew/bottles.rb
+++ b/Library/Homebrew/bottles.rb
@@ -1,8 +1,12 @@
require 'tab'
require 'extend/ARGV'
-def bottle_filename f
- "#{f.name}-#{f.version}#{bottle_native_suffix}"
+def bottle_filename f, bottle_version=nil
+ name = f.name.downcase
+ version = f.version || f.standard.detect_version
+ bottle_version = bottle_version || f.bottle_version
+ bottle_version_tag = bottle_version > 0 ? "-#{bottle_version}" : ""
+ "#{name}-#{version}#{bottle_version_tag}#{bottle_native_suffix}"
end
def bottles_supported?
@@ -21,6 +25,11 @@ def bottle_current? f
f.bottle_url && f.bottle_sha1 && Pathname.new(f.bottle_url).version == f.version
end
+def bottle_new_version f
+ return 0 unless f.bottle_version
+ f.bottle_version + 1
+end
+
def bottle_native_suffix
".#{MacOS.cat}#{bottle_suffix}"
end
@@ -30,11 +39,11 @@ def bottle_suffix
end
def bottle_native_regex
- /(\.#{MacOS.cat}\.bottle\.tar\.gz)$/
+ /((-\d+)?\.#{MacOS.cat}\.bottle\.tar\.gz)$/
end
def bottle_regex
- /(\.[a-z]+\.bottle\.tar\.gz)$/
+ /((-\d+)?\.[a-z]+\.bottle\.tar\.gz)$/
end
def old_bottle_regex