aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/macos/xquartz.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/macos/xquartz.rb b/Library/Homebrew/macos/xquartz.rb
index 670f16e37..07a5c3d3d 100644
--- a/Library/Homebrew/macos/xquartz.rb
+++ b/Library/Homebrew/macos/xquartz.rb
@@ -1,6 +1,7 @@
module MacOS::XQuartz extend self
FORGE_BUNDLE_ID = "org.macosforge.xquartz.X11"
APPLE_BUNDLE_ID = "org.x.X11"
+ FORGE_PKG_ID = "org.macosforge.xquartz.pkg"
# This returns the version number of XQuartz, not of the upstream X.org.
# The X11.app distributed by Apple is also XQuartz, and therefore covered
@@ -10,6 +11,9 @@ 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
+ else
+ # Some users disable Spotlight indexing. Try to find it via pkgutil
+ MacOS.pkgutil_info(FORGE_PKG_ID) =~ /version: (\d\.\d\.\d).+$/ and $1
end
end
end