Extract version_from_pkgutil
This commit is contained in:
parent
c325520316
commit
1a54e6a449
@ -14,9 +14,7 @@ module MacOS::XQuartz extend self
|
|||||||
elsif prefix.to_s == "/usr/X11"
|
elsif prefix.to_s == "/usr/X11"
|
||||||
guess_system_version
|
guess_system_version
|
||||||
else
|
else
|
||||||
# Finally, try to find it via pkgutil. This is slow, and only works
|
version_from_pkgutil
|
||||||
# for the upstream XQuartz package, so use it as a last resort.
|
|
||||||
MacOS.pkgutil_info(FORGE_PKG_ID)[/version: (\d\.\d\.\d).+$/, 1]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -45,6 +43,14 @@ module MacOS::XQuartz extend self
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 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]
|
||||||
|
end
|
||||||
|
|
||||||
def provided_by_apple?
|
def provided_by_apple?
|
||||||
[FORGE_BUNDLE_ID, APPLE_BUNDLE_ID].find do |id|
|
[FORGE_BUNDLE_ID, APPLE_BUNDLE_ID].find do |id|
|
||||||
MacOS.app_with_bundle_id(id)
|
MacOS.app_with_bundle_id(id)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user