diff options
| author | Jack Nagel | 2013-07-21 19:11:06 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-07-22 11:25:11 -0500 |
| commit | e33fcb52e07a40f756d40de08d421fb3c613ba68 (patch) | |
| tree | 5f480bcf43f0719187a37a599eb8655146820fb2 /Library/Homebrew/os | |
| parent | 50c59320a5b8f543d6d46bb1180660e5e0a7b0cf (diff) | |
| download | homebrew-e33fcb52e07a40f756d40de08d421fb3c613ba68.tar.bz2 | |
Fall back on pkgutil when mdls cannot determine XQuartz version
Diffstat (limited to 'Library/Homebrew/os')
| -rw-r--r-- | Library/Homebrew/os/mac/xquartz.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb index ed7473cef..b1bd45d2c 100644 --- a/Library/Homebrew/os/mac/xquartz.rb +++ b/Library/Homebrew/os/mac/xquartz.rb @@ -11,8 +11,8 @@ module MacOS::XQuartz extend self end def detect_version - if (path = bundle_path) && path.exist? - version_from_mdls(path) + if (path = bundle_path) && path.exist? && (version = version_from_mdls(path)) + version elsif prefix.to_s == "/usr/X11" guess_system_version else @@ -29,7 +29,8 @@ module MacOS::XQuartz extend self end def version_from_mdls(path) - `mdls -raw -name kMDItemVersion "#{path}" 2>/dev/null`.strip + version = `mdls -raw -nullMarker "" -name kMDItemVersion "#{path}" 2>/dev/null`.strip + version unless version.empty? end # The XQuartz that Apple shipped in OS X through 10.7 does not have a |
