Skip to content
Snippets Groups Projects
Commit 9b30fc4a authored by Jack Nagel's avatar Jack Nagel
Browse files

Map pkginfo versions to actual XQuartz versions

parent 34623b4e
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,17 @@ module MacOS::XQuartz extend self
APPLE_BUNDLE_ID = "org.x.X11"
FORGE_PKG_ID = "org.macosforge.xquartz.pkg"
PKGINFO_VERSION_MAP = {
"2.6.34" => "2.6.3",
"2.7.4" => "2.7.0",
"2.7.14" => "2.7.1",
"2.7.28" => "2.7.2",
"2.7.32" => "2.7.3",
"2.7.43" => "2.7.4",
"2.7.50" => "2.7.5_rc1",
"2.7.51" => "2.7.5_rc2",
}.freeze
# 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
# by this method.
......@@ -47,10 +58,9 @@ module MacOS::XQuartz extend self
# Upstream XQuartz *does* have a pkg-info entry, so if we can't get it
# from mdls, we can try pkgutil. This is very slow.
# NOTE: this sacrifices correctness, as it returns an internal version
# that may not always match the "user-facing" version string.
def version_from_pkgutil
MacOS.pkgutil_info(FORGE_PKG_ID)[/version: (\d\.\d\.\d).+$/, 1]
str = MacOS.pkgutil_info(FORGE_PKG_ID)[/version: (\d\.\d\.\d+)$/, 1]
PKGINFO_VERSION_MAP.fetch(str, str)
end
def provided_by_apple?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment