Configure portage(5)
salt.modules.portage_config.
append_to_package_conf
(conf, atom='', flags=None, string='', overwrite=False)¶Append a string or a list of flags for a given package or DEPEND atom to a given configuration file.
CLI 范例:
salt '*' portage_config.append_to_package_conf use string="app-admin/salt ldap -libvirt"
salt '*' portage_config.append_to_package_conf use atom="> = app-admin/salt-0.14.1" flags="['ldap', '-libvirt']"
salt.modules.portage_config.
append_use_flags
(atom, uses=None, overwrite=False)¶Append a list of use flags for a given package or DEPEND atom
CLI 范例:
salt '*' portage_config.append_use_flags "app-admin/salt[ldap, -libvirt]"
salt '*' portage_config.append_use_flags ">=app-admin/salt-0.14.1" "['ldap', '-libvirt']"
salt.modules.portage_config.
enforce_nice_config
()¶Enforce a nice tree structure for /etc/portage/package.* configuration files.
参见
salt.modules.ebuild.ex_mod_init()
CLI 范例:
salt '*' portage_config.enforce_nice_config
salt.modules.portage_config.
filter_flags
(use, use_expand_hidden, usemasked, useforced)¶2015.8.0 新版功能.
Filter function to remove hidden or otherwise not normally visible USE flags from a list.
@type use: list @param use: the USE flag list to be filtered. @type use_expand_hidden: list @param use_expand_hidden: list of flags hidden. @type usemasked: list @param usemasked: list of masked USE flags. @type useforced: list @param useforced: the forced USE flags. @rtype: list @return the filtered USE flags.
salt.modules.portage_config.
get_all_cpv_use
(cp)¶2015.8.0 新版功能.
Uses portage to determine final USE flags and settings for an emerge.
@type cp: string @param cp: eg cat/pkg @rtype: lists @return use, use_expand_hidden, usemask, useforce
salt.modules.portage_config.
get_cleared_flags
(cp)¶2015.8.0 新版功能.
Uses portage for compare use flags which is used for installing package and use flags which now exist int /etc/portage/package.use/
@type cp: string @param cp: eg cat/pkg @rtype: tuple @rparam: tuple with two lists - list of used flags and list of flags which will be used
salt.modules.portage_config.
get_flags_from_package_conf
(conf, atom)¶Get flags for a given package or DEPEND atom. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config)
CLI 范例:
salt '*' portage_config.get_flags_from_package_conf license salt
salt.modules.portage_config.
get_installed_use
(cp, use='USE')¶2015.8.0 新版功能.
Gets the installed USE flags from the VARDB.
@type: cp: string @param cp: cat/pkg @type use: string @param use: 1 of ["USE", "PKGUSE"] @rtype list @returns [] or the list of IUSE flags
salt.modules.portage_config.
get_iuse
(cp)¶2015.8.0 新版功能.
Gets the current IUSE flags from the tree.
@type: cpv: string @param cpv: cat/pkg @rtype list @returns [] or the list of IUSE flags
salt.modules.portage_config.
get_missing_flags
(conf, atom, flags)¶Find out which of the given flags are currently not set. CLI Example:
salt '*' portage_config.get_missing_flags use salt "['ldap', '-libvirt', 'openssl']"
salt.modules.portage_config.
has_flag
(conf, atom, flag)¶Verify if the given package or DEPEND atom has the given flag. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config)
CLI 范例:
salt '*' portage_config.has_flag license salt Apache-2.0
salt.modules.portage_config.
has_use
(atom, use)¶Verify if the given package or DEPEND atom has the given use flag. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config)
CLI 范例:
salt '*' portage_config.has_use salt libvirt
salt.modules.portage_config.
is_changed_uses
(cp)¶2015.8.0 新版功能.
Uses portage for determine if the use flags of installed package is compatible with use flags in portage configs.
@type cp: string @param cp: eg cat/pkg
salt.modules.portage_config.
is_present
(conf, atom)¶Tell if a given package or DEPEND atom is present in the configuration files tree. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config)
CLI 范例:
salt '*' portage_config.is_present unmask salt