aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/macos
diff options
context:
space:
mode:
authorJack Nagel2013-01-02 22:54:36 -0600
committerJack Nagel2013-01-02 23:20:06 -0600
commit7a4facae2fc4468e2bc80c847ede1e51a1ed6230 (patch)
tree141e0700ea7d96c22ed229ba5fc0eb20e79d2047 /Library/Homebrew/macos
parent05f29e7463e793ec3c77d5b1b1d2264a44887810 (diff)
downloadbrew-7a4facae2fc4468e2bc80c847ede1e51a1ed6230.tar.bz2
Guess system XQuartz version when mdfind fails
Fixes Homebrew/homebrew#16857.
Diffstat (limited to 'Library/Homebrew/macos')
-rw-r--r--Library/Homebrew/macos/xquartz.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/Library/Homebrew/macos/xquartz.rb b/Library/Homebrew/macos/xquartz.rb
index 07a5c3d3d..77b75f358 100644
--- a/Library/Homebrew/macos/xquartz.rb
+++ b/Library/Homebrew/macos/xquartz.rb
@@ -11,8 +11,19 @@ module MacOS::XQuartz extend self
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
+ elsif prefix.to_s == "/usr/X11"
+ # Some users disable Spotlight indexing. If we're working with the
+ # system X11 distribution, we can't get the version from pkgutil, so
+ # just use the expected version.
+ case MacOS.version
+ when 10.5 then "2.1.6"
+ when 10.6 then "2.3.6"
+ when 10.7 then "2.6.3"
+ else :dunno
+ end
else
- # Some users disable Spotlight indexing. Try to find it via pkgutil
+ # Finally, try to find it via pkgutil. This is slow, and only works
+ # for the upstream XQuartz package, so use it as a last resort.
MacOS.pkgutil_info(FORGE_PKG_ID) =~ /version: (\d\.\d\.\d).+$/ and $1
end
end