Resources needed by pkg providers
Add a package to a dict of installed packages.
CLI Example:
salt '*' pkg_resource.add_pkg '{}' bind 9
Check if the installed package already has the given requirements. This function will simply try to call "pkg.check_extra_requirements".
CLI Example:
salt '*' pkg_resource.check_extra_requirements <pkgname> <extra_requirements>
Accepts list of dicts (or a string representing a list of dicts) and packs the key/value pairs into a single dict.
'[{"foo": "salt://foo.rpm"}, {"bar": "salt://bar.rpm"}]' would become {"foo": "salt://foo.rpm", "bar": "salt://bar.rpm"}
CLI Example:
salt '*' pkg_resource.pack_sources '[{"foo": "salt://foo.rpm"}, {"bar": "salt://bar.rpm"}]'
Parses the input to pkg.install and returns back the package(s) to be installed. Returns a list of packages, as well as a string noting whether the packages are to come from a repository or a binary package.
CLI Example:
salt '*' pkg_resource.parse_targets
Accepts a dict obtained from pkg.list_pkgs() and sorts in place the list of versions for any packages that have multiple versions installed, so that two package lists can be compared to one another.
CLI Example:
salt '*' pkg_resource.sort_pkglist '["3.45", "2.13"]'
Takes a dict of package name/version information and joins each list of installed versions into a string.
CLI Example:
salt '*' pkg_resource.stringify 'vim: 7.127'
Common interface for obtaining the version of installed packages.
CLI Example:
salt '*' pkg_resource.version vim
salt '*' pkg_resource.version foo bar baz
salt '*' pkg_resource.version 'python*'
Clean the version string removing extra data. This function will simply try to call pkg.version_clean.
CLI Example:
salt '*' pkg_resource.version_clean <version_string>
Current Salt release: 2014.1.6
Docs for previous releases on salt.rtfd.org.