Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix up local_nvra and fix for a missing localinstall rpm file. #938

Merged
merged 1 commit into from
Aug 24, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion library/yum
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def local_nvra(path):
"""return nvra of a local rpm passed in"""

cmd = ['/bin/rpm', '-qp' ,'--qf',
'%%{name}-%%{version}-%%{release}.%%{arch}\n', path ]
'%{name}-%{version}-%{release}.%{arch}\n', path ]
rc, out, err = run(cmd)
if rc != 0:
return None
Expand Down Expand Up @@ -285,6 +285,10 @@ def install(module, items, repoq, yum_basecmd, conf_file):
# localpkg
if spec.endswith('.rpm'):
# get the pkg name-v-r.arch
if not os.path.exists(spec):
res['msg'] += "No Package file matching '%s' found on system" % spec
module.fail_json(**res)

nvra = local_nvra(spec)
# look for them in the rpmdb
if is_installed(repoq, nvra, conf_file):
Expand Down