- meta_package_manager.bitbar package
- meta_package_manager.managers package
- meta_package_manager.tests package
CLIError(code, output, error)¶
An error occured when running package manager CLI.
The exception internally keeps the result of CLI execution.
Base class from which all package manager definition should inherits.
Invoke the manager and extract its own reported version.
Raw but cleaned string of the package manager version.
Returns None if the manager had an issue extracting its version.
Parsed and normalized package manager’s own version.
Returns an instance of
Return package manager’s ID. Defaults based on class name.
This ID must be unique among all package manager definitions and lower-case as they’re used as feature flags for the mpm CLI.
Return package manager’s common name. Defaults based on class name.
Is the package manager supported on that platform?
Is the package manager CLI exist on the system?
Is the package manager CLI can be executed by the current user?
Does the package manager match the version requirement?
Is the package manager available and ready-to-use on the system?
- Returns True only if the main CLI:
- 1 - is supported on the current platform, 2 - exists on the system, 3 - is executable, and 4 - match the version requirement.
Run a shell command, return the output and keep error message.
Removes ANSI escape codes, and returns ready-to-use strings.
Fetch latest versions of installed packages.
List packaages currently installed on the system.
Returns a list of dict with package ID, name and version.
List currently installed packages having a new version available.
Returns a list of dict with package ID, name, current installed version and latest upgradeable version.
Return a bash-compatible full-CLI to upgrade a package.
Perform the upgrade of the provided package to latest version.
Return a bash-compatible full-CLI to upgrade all packages.
Perform a full upgrade of all outdated packages to latest versions.
If the manager doesn’t implements a full upgrade one-liner, then fall-back to calling single-package upgrade one by one.
Return a formatted CLI in the provided format.
Format a bash-runnable full-CLI with parameters into bitbar schema.
Utility function to render data structure into pretty printed JSON.
Helpers and utilities to handle platform idiosyncracies.
Return True only if current platform is Linux.
Return True only if current platform is macOS.
Return True only if current platform is Windows.
Return ID and label of current OS.
Return platform label for user-friendly output.
Expose package-wide elements.