Skip to content

Commit

Permalink
python: mkvenv: tweak the matching of --diagnose to depspecs
Browse files Browse the repository at this point in the history
Move the matching between the "absent" array and dep_specs[0] inside
the loop, preparing for the possibility of having multiple canaries
among the installed packages.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Aug 28, 2023
1 parent 87f77f5 commit 67b9a83
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/scripts/mkvenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ def _do_ensure(
"""
absent = []
present = []
canary = None
for spec in dep_specs:
matcher = distlib.version.LegacyMatcher(spec)
ver = _get_version(matcher.name)
Expand All @@ -817,6 +818,8 @@ def _do_ensure(
or not matcher.match(distlib.version.LegacyVersion(ver))
):
absent.append(spec)
if spec == dep_specs[0]:
canary = prog
else:
logger.info("found %s %s", matcher.name, ver)
present.append(matcher.name)
Expand All @@ -839,7 +842,7 @@ def _do_ensure(
absent[0],
online,
wheels_dir,
prog if absent[0] == dep_specs[0] else None,
canary,
)

return None
Expand Down

0 comments on commit 67b9a83

Please sign in to comment.