diff options
| author | Mike McQuaid | 2017-11-05 12:09:31 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2017-11-05 15:39:43 +0000 |
| commit | 389188ac4fcac42db3b4ef2e31557147890a861a (patch) | |
| tree | fa05ddb16f25fd67c5278c822e9078b3f43c2f11 /Library | |
| parent | 600d58f4ca3d85894c66a38802965fd94d4ea469 (diff) | |
| download | brew-389188ac4fcac42db3b4ef2e31557147890a861a.tar.bz2 | |
mac/xquartz: compare with existing Version class.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/os/mac/xquartz.rb | 14 |
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 |
