diff options
| author | Jack Nagel | 2012-12-21 12:55:38 -0600 |
|---|---|---|
| committer | Jack Nagel | 2012-12-21 12:55:38 -0600 |
| commit | 43108e42d95a892cc5e9227c32eaa1174588891e (patch) | |
| tree | 46c8b5d711ca42386b5e9a3ac7717884ad786823 /Library | |
| parent | 89b5ee6295fbd399e4aabf186354fb29a36d9424 (diff) | |
| download | brew-43108e42d95a892cc5e9227c32eaa1174588891e.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 |
