don't apply enablerepo's to is_installed() to work around yum-utils/repoquery drift from all things

good and proper
reviewable/pr18780/r1
Seth Vidal 12 years ago
parent 818f8c7de6
commit 7d3f6fdb3c

29
yum

@ -168,6 +168,13 @@ def is_available(module, repoq, pkgspec, conf_file, qf=def_qf, en_repos=[], dis_
return [ po_to_nevra(p) for p in pkgs ] return [ po_to_nevra(p) for p in pkgs ]
else: else:
for repoid in en_repos:
r_cmd = ['--enablerepo', repoid]
repoq.extend(r_cmd)
for repoid in dis_repos:
r_cmd = ['--disablerepo', repoid]
repoq.extend(r_cmd)
cmd = repoq + ["--qf", qf, pkgspec] cmd = repoq + ["--qf", qf, pkgspec]
rc,out,err = module.run_command(cmd) rc,out,err = module.run_command(cmd)
@ -209,6 +216,14 @@ def is_update(module, repoq, pkgspec, conf_file, qf=def_qf, en_repos=[], dis_rep
return set([ po_to_nevra(p) for p in retpkgs ]) return set([ po_to_nevra(p) for p in retpkgs ])
else: else:
for repoid in en_repos:
r_cmd = ['--enablerepo', repoid]
repoq.extend(r_cmd)
for repoid in dis_repos:
r_cmd = ['--disablerepo', repoid]
repoq.extend(r_cmd)
cmd = repoq + ["--pkgnarrow=updates", "--qf", qf, pkgspec] cmd = repoq + ["--pkgnarrow=updates", "--qf", qf, pkgspec]
rc,out,err = module.run_command(cmd) rc,out,err = module.run_command(cmd)
@ -247,6 +262,14 @@ def what_provides(module, repoq, req_spec, conf_file, qf=def_qf, en_repos=[], d
else: else:
for repoid in en_repos:
r_cmd = ['--enablerepo', repoid]
repoq.extend(r_cmd)
for repoid in dis_repos:
r_cmd = ['--disablerepo', repoid]
repoq.extend(r_cmd)
cmd = repoq + ["--qf", qf, "--whatprovides", req_spec] cmd = repoq + ["--qf", qf, "--whatprovides", req_spec]
rc,out,err = module.run_command(cmd) rc,out,err = module.run_command(cmd)
cmd = repoq + ["--qf", qf, req_spec] cmd = repoq + ["--qf", qf, req_spec]
@ -539,16 +562,10 @@ def ensure(module, state, pkgspec, conf_file, enablerepo, disablerepo):
r_cmd = ['--enablerepo', repoid] r_cmd = ['--enablerepo', repoid]
yum_basecmd.extend(r_cmd) yum_basecmd.extend(r_cmd)
if repoq:
repoq.extend(r_cmd)
for repoid in dis_repos: for repoid in dis_repos:
r_cmd = ['--disablerepo', repoid] r_cmd = ['--disablerepo', repoid]
yum_basecmd.extend(r_cmd) yum_basecmd.extend(r_cmd)
if repoq:
repoq.extend(r_cmd)
if state in ['installed', 'present', 'latest']: if state in ['installed', 'present', 'latest']:
my = yum_base(conf_file) my = yum_base(conf_file)
try: try:

Loading…
Cancel
Save