mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #47045 from tankywoo/fix-gentoo-pkg-installed
Fix ba7d00f5
for gentoo pkg.installed method
This commit is contained in:
commit
6c16a34c44
2 changed files with 21 additions and 0 deletions
|
@ -90,6 +90,13 @@ def _p_to_cp(p):
|
|||
except portage.exception.InvalidAtom:
|
||||
pass
|
||||
|
||||
try:
|
||||
ret = _porttree().dbapi.xmatch("match-all", p)
|
||||
if ret:
|
||||
return portage.cpv_getkey(ret[0])
|
||||
except portage.exception.InvalidAtom:
|
||||
pass
|
||||
|
||||
return None
|
||||
|
||||
|
||||
|
@ -110,6 +117,13 @@ def _cpv_to_cp(cpv):
|
|||
except portage.exception.InvalidAtom:
|
||||
pass
|
||||
|
||||
try:
|
||||
ret = portage.cpv_getkey(cpv)
|
||||
if ret:
|
||||
return ret
|
||||
except portage.exception.InvalidAtom:
|
||||
pass
|
||||
|
||||
return cpv
|
||||
|
||||
|
||||
|
|
|
@ -111,6 +111,13 @@ def _p_to_cp(p):
|
|||
except portage.exception.InvalidAtom:
|
||||
pass
|
||||
|
||||
try:
|
||||
ret = _porttree().dbapi.xmatch("match-all", p)
|
||||
if ret:
|
||||
return portage.cpv_getkey(ret[0])
|
||||
except portage.exception.InvalidAtom:
|
||||
pass
|
||||
|
||||
return None
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue