fixes to yum module
include local_nvra change the remove behavior to pretty much NEVEr error out if the pkg is not there (or anywhere)
This commit is contained in:
parent
14479e6adc
commit
3175eacfc4
1 changed files with 11 additions and 0 deletions
11
library/yum
11
library/yum
|
@ -168,6 +168,17 @@ def what_provides(module, repoq, req_spec, conf_file, qf=def_qf):
|
||||||
|
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
def local_nvra(path):
|
||||||
|
"""return nvra of a local rpm passed in"""
|
||||||
|
|
||||||
|
cmd = ['/bin/rpm', '-qp' ,'--qf',
|
||||||
|
'%%{name}-%%{version}-%%{release}.%%{arch}\n', path ]
|
||||||
|
rc, out, err = run(cmd)
|
||||||
|
if rc != 0:
|
||||||
|
return None
|
||||||
|
nvra = out.split('\n')[0]
|
||||||
|
return nvra
|
||||||
|
|
||||||
def pkg_to_dict(pkgstr):
|
def pkg_to_dict(pkgstr):
|
||||||
if pkgstr.strip():
|
if pkgstr.strip():
|
||||||
n,e,v,r,a,repo = pkgstr.split('|')
|
n,e,v,r,a,repo = pkgstr.split('|')
|
||||||
|
|
Loading…
Reference in a new issue