aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-11-05 12:09:31 +0000
committerMike McQuaid2017-11-05 15:39:43 +0000
commit389188ac4fcac42db3b4ef2e31557147890a861a (patch)
treefa05ddb16f25fd67c5278c822e9078b3f43c2f11 /Library
parent600d58f4ca3d85894c66a38802965fd94d4ea469 (diff)
downloadbrew-389188ac4fcac42db3b4ef2e31557147890a861a.tar.bz2
mac/xquartz: compare with existing Version class.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/os/mac/xquartz.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb
index ddb2aa4fa..efbb5b738 100644
--- a/Library/Homebrew/os/mac/xquartz.rb
+++ b/Library/Homebrew/os/mac/xquartz.rb
@@ -34,7 +34,11 @@ module OS
# The X11.app distributed by Apple is also XQuartz, and therefore covered
# by this method.
def version
- @version ||= detect_version
+ if @version ||= detect_version
+ ::Version.new @version
+ else
+ ::Version::NULL
+ end
end
def detect_version
@@ -115,7 +119,13 @@ module OS
end
def installed?
- !version.nil? && !prefix.nil?
+ !version.null? && !prefix.nil?
+ end
+
+ def outdated?
+ return false unless installed?
+ return false if provided_by_apple?
+ version < latest_version
end
# If XQuartz and/or the CLT are installed, headers will be found under