Crate upm_lib [] [src]

The universal package manager library (upm-lib) provides an abstraction to perform simple commands with any package manager. Currently there are no frontends implemented, but the functionality is exposed for frontends to utilize. Feel free to implement a frontend!

If you want to do something with a particular package manager then this probably isn't the library for you. If you want to query multiple package managers at once to search for a package provided by multiple sources, then this is the library for you. This is common for language specific binaries that are provided by language package managers and system package managers.

Since certain package managers such as NPM allow installation in a user's home directory or somewhere accessible for all users, there is a distinction between installation and removal of packages on a system-wide level and a local level.

It is expected that the frontend would load in the different package managers from configuration files as discussed in PackageManager.

Versioning is provided by the Version struct. Version is used in place of semver due to the need to support non-semantic versions.

Structs

Package

Information on a package from a particular package manager

PackageManager

The representation of a package manager. Includes the name of the package manager, a path to reference scripts from, and commands in string form (or scripts to call package manager commands and properly format the output).

Version

A simple representation of a version string. For semantic versioning Steve Klabnik's semver crate is preferable. But non-semantic versioning is also permitted in this struct.

Enums

ManagerSpecifier

Provide a single type to exclude or solely include certain packagemanager names.

Functions

get_managers

Get a vector of any package managers specified in the given directory.

read_config_dirs

Read the configuration directories listed from highest precedence to lowest with the option to explicitly exclude or include certain package managers. If the include variant of ManagerSpecifier is used then only the specified packagemanager names will be returned if they exist.