Update lib/ansible/modules/apt.py

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
pull/81364/head
jsh 9 months ago committed by GitHub
parent 7c72d02e45
commit afa93a7b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -505,9 +505,10 @@ def package_best_match(pkgname, version_cmp, version, release, cache):
# We don't mimmic this exactly, but instead set a priority which is higher than all APT built-in pin priorities.
try:
pkgver = next(v1 for v1 in pkg.version_list if v1.ver_str == version)
policy.set_priority(pkgver, 0)
except StopIteration:
pass
else:
policy.set_priority(pkgver, 0)
policy.create_pin('Version', pkgname, version, 1001)
pkgver = policy.get_candidate_ver(pkg)
if not pkgver:

Loading…
Cancel
Save