ocebuild.pipeline.kexts#

Methods for retrieving and handling Kext packages and binaries.

Module Contents#

Functions#

parse_kext_plist(→ dict)

Parses the Info.plist of a Kext.

sort_kext_cfbundle(→ collections.OrderedDict)

Sorts the injection order of Kexts based on their CFBundleidentifier.

extract_kexts(→ dict)

Extracts the metadata of all Kexts in a directory.

ocebuild.pipeline.kexts.parse_kext_plist(filepath: str | ocebuild.third_party.cpython.pathlib.Path) dict[source]#

Parses the Info.plist of a Kext.

ocebuild.pipeline.kexts.sort_kext_cfbundle(filepaths: List[str | ocebuild.third_party.cpython.pathlib.Path]) collections.OrderedDict[source]#

Sorts the injection order of Kexts based on their CFBundleidentifier.

This implementation uses a topological sort to order Kexts based on their CFBundleidentifiers and versions. This handles duplicate versions across kexts and their dependencies and ensures that Kexts are injected in the correct order with respect to their dependencies and notes their resolved minimum required versions.

Dependent Kexts are always injected before their dependents, and duplicate CFBundleIdentifier dependencies are inserted in order of the latest version strings. Additionally, any bundled Kexts are grouped with their parent Kexts.

Parameters:

filepaths – A list of filepaths to Kext *.kext files.

Raises:

ValueError – If a Kext is missing a CFBundleidentifier key or a dependency.

Returns:

An sorted dictionary array of Kexts sorted by their CFBundleIdentifier.

ocebuild.pipeline.kexts.extract_kexts(directory: str | ocebuild.third_party.cpython.pathlib.Path, build: Literal[RELEASE, DEBUG] = 'RELEASE') dict[source]#

Extracts the metadata of all Kexts in a directory.