mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add support for epoch in Zypper
This commit is contained in:
parent
12d515fa0c
commit
4336487765
1 changed files with 4 additions and 2 deletions
|
@ -314,7 +314,7 @@ def list_pkgs(versions_as_list=False, **kwargs):
|
|||
__salt__['pkg_resource.stringify'](ret)
|
||||
return ret
|
||||
|
||||
cmd = ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{VERSION}_|-%{RELEASE}\\n']
|
||||
cmd = ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{VERSION}_|-%{RELEASE}_|-%|EPOCH?{%{EPOCH}}:{}|\\n']
|
||||
ret = {}
|
||||
out = __salt__['cmd.run'](
|
||||
cmd,
|
||||
|
@ -322,7 +322,9 @@ def list_pkgs(versions_as_list=False, **kwargs):
|
|||
python_shell=False
|
||||
)
|
||||
for line in out.splitlines():
|
||||
name, pkgver, rel = line.split('_|-')
|
||||
name, pkgver, rel, epoch = line.split('_|-')
|
||||
if epoch:
|
||||
pkgver = '{0}:{1}'.format(epoch, pkgver)
|
||||
if rel:
|
||||
pkgver += '-{0}'.format(rel)
|
||||
__salt__['pkg_resource.add_pkg'](ret, name, pkgver)
|
||||
|
|
Loading…
Add table
Reference in a new issue