Generic code for interacting with distribution package managers.
#
elem
| : [ | `package_impl ] Element.t | ; | |||
#
package_name
| : string | ; | |||
#
elem_props
| : Impl.properties | ; | |||
#
feed
| : Feed.feed | ; | |||
#
results
| : Impl.distro_implementation Support.Common.StringMap.t Pervasives.ref | ; |
Passed to distribution#get_package_impls
. It provides details of the query and a place to collect the results.
All IDs will start with this string (e.g. "package:deb")
Paths to search for missing binaries (i.e. the platform default for $PATH)
Can we use packages for this distribution? For example, MacPortsDistribution can use "MacPorts" and "Darwin" packages.
Test whether this <selection> element is still valid. The default implementation tries to load the feed from the
feed cache, calls distribution#get_impls_for_feed
on it and checks whether the required implementation ID is in the
returned map. Override this if you can provide a more efficient implementation.
Add the implementations for this feed to query
.
Called by get_impls_for_feed
once for each <package-implementation> element.
This default implementation adds anything found previously by PackageKit.
Get the native implementations (installed or candidates for installation) for this feed.
This default implementation finds the best <package-implementation> elements and calls get_package_impls
on each one.
Check (asynchronously) for available but currently uninstalled candidates. Once the returned
promise resolves, the candidates should be included in future responses from get_package_impls
.
Install a set of packages of a given type (as set previously by check_for_candidates
).
Normally called only by the Distro.install_distro_packages
function.
Check whether this name is possible for this distribution. The default implementation filters using valid_package_name
.
Called when an installed package is added, or when installation completes, to find the correct main value,
since we might not be able to work it out before-hand. The default checks that the path exists and, if not,
searches system_paths
for it.
Note: Only called if the implementation already has a "run" command.
Add a new Feed.implementation result to query
.
Check whether this <selection> is still valid. If the quick-test-* attributes are present, we use
them to check. Otherwise, we call distribution#is_installed
.
Install these packages using the distribution's package manager.
Sorts the implementations into groups by their type and then calls distribution#install_distro_packages
once for each group.
Return the <package-implementation> elements that best match this distribution.