diff options
| author | Jack Nagel | 2012-12-21 12:55:38 -0600 |
|---|---|---|
| committer | Jack Nagel | 2012-12-21 12:55:38 -0600 |
| commit | 14fe3ae763c4a86a20cf3fe054f69279e4e37bd6 (patch) | |
| tree | e5b8c355c4290a45d2a5d78025a518f06af69c35 /Library | |
| parent | 37a3ce75d7fb8569dc30f54e191cb15ca4c6bee8 (diff) | |
| download | homebrew-14fe3ae763c4a86a20cf3fe054f69279e4e37bd6.tar.bz2 | |
Make "XQuartz is installed" heurstic stricter
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/macos/xquartz.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/Homebrew/macos/xquartz.rb b/Library/Homebrew/macos/xquartz.rb index 6e64901fc..670f16e37 100644 --- a/Library/Homebrew/macos/xquartz.rb +++ b/Library/Homebrew/macos/xquartz.rb @@ -6,9 +6,11 @@ module MacOS::XQuartz extend self # The X11.app distributed by Apple is also XQuartz, and therefore covered # by this method. def version - path = MacOS.app_with_bundle_id(FORGE_BUNDLE_ID) || MacOS.app_with_bundle_id(APPLE_BUNDLE_ID) - version = if not path.nil? and path.exist? - `mdls -raw -name kMDItemVersion "#{path}" 2>/dev/null`.strip + @version ||= begin + path = MacOS.app_with_bundle_id(FORGE_BUNDLE_ID) || MacOS.app_with_bundle_id(APPLE_BUNDLE_ID) + if not path.nil? and path.exist? + `mdls -raw -name kMDItemVersion "#{path}" 2>/dev/null`.strip + end end end @@ -34,7 +36,7 @@ module MacOS::XQuartz extend self end def installed? - not prefix.nil? + !version.nil? && !prefix.nil? end end |
