diff options
| author | Jack Nagel | 2012-12-22 14:24:25 -0600 |
|---|---|---|
| committer | Jack Nagel | 2012-12-22 14:27:22 -0600 |
| commit | a56a0dadad894228ebff137829349506cf374a68 (patch) | |
| tree | b3df7f85b2549d8b9bad0721e5a0fb8e20d6dd36 /Library | |
| parent | d2d4813a07ccc077690bb86e522744fa19d2bdd4 (diff) | |
| download | brew-a56a0dadad894228ebff137829349506cf374a68.tar.bz2 | |
Try to find XQuartz via pkgutil if mdls fails
c.f. Homebrew/homebrew#16296.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/macos/xquartz.rb | 4 |
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 |
