aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tab.rb
diff options
context:
space:
mode:
authorAlyssa Ross2016-12-30 16:16:28 +0000
committerAlyssa Ross2016-12-30 16:16:28 +0000
commitbdbc19c614dd9f787c92ce3e0f62180d2238f177 (patch)
tree10c6cec324abf0db9df802f92ffda61fa496314a /Library/Homebrew/tab.rb
parenta69997cab03988f381894b08d4b82d25014e8fed (diff)
downloadbrew-bdbc19c614dd9f787c92ce3e0f62180d2238f177.tar.bz2
tab: implement #reliable_runtime_dependencies?
Diffstat (limited to 'Library/Homebrew/tab.rb')
-rw-r--r--Library/Homebrew/tab.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index 40626bad1..332237a57 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -242,6 +242,26 @@ class Tab < OpenStruct
super || DevelopmentTools.default_compiler
end
+ def homebrew_tag
+ homebrew_version.sub(/\-\d+\-g([a-f0-9]+)(?:\-dirty)?\Z/, "")
+ end
+
+ def parsed_homebrew_version
+ return Version::NULL if homebrew_version.nil?
+ Version.new(homebrew_tag)
+ end
+
+ # Whether there is reliable runtime dependency information in the receipt.
+ def reliable_runtime_dependencies?
+ return false if runtime_dependencies.nil?
+
+ # Homebrew versions prior to 1.1.6 generated incorrect runtime dependency
+ # lists.
+ return false if parsed_homebrew_version < "1.1.6"
+
+ true
+ end
+
def cxxstdlib
# Older tabs won't have these values, so provide sensible defaults
lib = stdlib.to_sym if stdlib