mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
salt/modules/yumpkg.py: accept ignore_epoch argument
This commit is contained in:
parent
c2791117af
commit
5ae9463c1f
@ -654,7 +654,7 @@ def version(*names, **kwargs):
|
||||
return __salt__['pkg_resource.version'](*names, **kwargs)
|
||||
|
||||
|
||||
def version_cmp(pkg1, pkg2):
|
||||
def version_cmp(pkg1, pkg2, ignore_epoch=False):
|
||||
'''
|
||||
.. versionadded:: 2015.5.4
|
||||
|
||||
@ -662,6 +662,11 @@ def version_cmp(pkg1, pkg2):
|
||||
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
|
||||
making the comparison.
|
||||
|
||||
ignore_epoch : False
|
||||
Set to ``True`` to ignore the epoch when comparing versions
|
||||
|
||||
.. versionadded:: 2015.8.10,2016.3.2
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
@ -669,7 +674,7 @@ def version_cmp(pkg1, pkg2):
|
||||
salt '*' pkg.version_cmp '0.2-001' '0.2.0.1-002'
|
||||
'''
|
||||
|
||||
return __salt__['lowpkg.version_cmp'](pkg1, pkg2)
|
||||
return __salt__['lowpkg.version_cmp'](pkg1, pkg2, ignore_epoch=ignore_epoch)
|
||||
|
||||
|
||||
def list_pkgs(versions_as_list=False, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user