aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-11-01 20:33:24 +0800
committerMike McQuaid2015-11-01 08:22:18 -0800
commitff9fdc078f883f6dba57513d182bab969794f4de (patch)
tree2989121c551c801aaba54496e58d1d2b924e6b37
parent593dff3dc1d038475acdd1f1503e60d7cfb2605b (diff)
downloadbrew-ff9fdc078f883f6dba57513d182bab969794f4de.tar.bz2
add Formula#bottle_defined?
-rw-r--r--Library/Homebrew/formula.rb10
-rw-r--r--Library/Homebrew/software_spec.rb4
2 files changed, 13 insertions, 1 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index fd8baf4a4..ffbd02cfc 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -231,6 +231,13 @@ class Formula
active_spec.bottle_disable_reason
end
+ # Does the currently active {SoftwareSpec} has any bottle?
+ # @private
+ def bottle_defined?
+ active_spec.bottle_defined?
+ end
+
+ # Does the currently active {SoftwareSpec} has an installable bottle?
# @private
def bottled?
active_spec.bottled?
@@ -1197,7 +1204,8 @@ class Formula
hsh["bottle"] = {}
%w[stable devel].each do |spec_sym|
next unless spec = send(spec_sym)
- next unless (bottle_spec = spec.bottle_specification).checksums.any?
+ next unless spec.bottle_defined?
+ bottle_spec = spec.bottle_specification
bottle_info = {
"revision" => bottle_spec.revision,
"cellar" => (cellar = bottle_spec.cellar).is_a?(Symbol) ? \
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index d2c811b69..92b6b7a9c 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -75,6 +75,10 @@ class SoftwareSpec
@bottle_disable_reason
end
+ def bottle_defined?
+ bottle_specification.collector.keys.any?
+ end
+
def bottled?
bottle_specification.tag?(bottle_tag) && \
(bottle_specification.compatible_cellar? || ARGV.force_bottle?)