aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/bottles.rb
diff options
context:
space:
mode:
authorMike McQuaid2013-02-09 19:06:54 -0800
committerMike McQuaid2013-03-01 17:49:09 +0000
commit360af367a816fa2f7b736a270decdd0626f02f22 (patch)
tree360fe5d1f6c960e7c6a46079da81f3d595141323 /Library/Homebrew/bottles.rb
parent161104cae70f3207b247331d182dc47c0b8c8a06 (diff)
downloadbrew-360af367a816fa2f7b736a270decdd0626f02f22.tar.bz2
Cleanup bottle DSL.
* Remove legacy url syntax. * Use revision instead of version. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/bottles.rb')
-rw-r--r--Library/Homebrew/bottles.rb31
1 files changed, 17 insertions, 14 deletions
diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb
index 88cfc5830..d474a6f65 100644
--- a/Library/Homebrew/bottles.rb
+++ b/Library/Homebrew/bottles.rb
@@ -2,22 +2,25 @@ require 'tab'
require 'macos'
require 'extend/ARGV'
-def bottle_filename f, bottle_version=nil
+def bottle_filename f, bottle_revision=nil
name = f.name.downcase
version = f.stable.version
- bottle_version ||= f.bottle.revision.to_i
- "#{name}-#{version}#{bottle_native_suffix(bottle_version)}"
+ bottle_revision ||= f.bottle.revision.to_i
+ "#{name}-#{version}#{bottle_native_suffix(bottle_revision)}"
end
def install_bottle? f
return true if ARGV.include? '--install-bottle' and MacOS.bottles_supported?(true)
return true if f.downloader and defined? f.downloader.local_bottle_path \
and f.downloader.local_bottle_path
- not ARGV.build_from_source? \
- and MacOS.bottles_supported? \
- and f.pour_bottle? \
- and f.build.used_options.empty? \
- and bottle_current?(f)
+
+ return false if ARGV.build_from_source?
+ return false unless MacOS.bottles_supported?
+ return false unless f.pour_bottle?
+ return false unless f.build.used_options.empty?
+ return false unless bottle_current?(f)
+
+ true
end
def built_as_bottle? f
@@ -45,18 +48,18 @@ def bottle_file_outdated? f, file
bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext
end
-def bottle_new_version f
+def bottle_new_revision f
return 0 unless bottle_current? f
f.bottle.revision + 1
end
-def bottle_native_suffix version=nil
- ".#{MacOS.cat}#{bottle_suffix(version)}"
+def bottle_native_suffix revision=nil
+ ".#{MacOS.cat}#{bottle_suffix(revision)}"
end
-def bottle_suffix version=nil
- version = version.to_i > 0 ? ".#{version}" : ""
- ".bottle#{version}.tar.gz"
+def bottle_suffix revision=nil
+ revision = revision.to_i > 0 ? ".#{revision}" : ""
+ ".bottle#{revision}.tar.gz"
end
def bottle_native_regex