From f73ff0502987349127d7dba92342468ea413b790 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Mar 06 2023 15:06:30 +0000 Subject: Fix verbose resolve-deps after allowing SRPMs in its output In the commit 9b8b59 we've allowed SRPMs to be listed in the verbose of output of `fedora resolve-deps`. This uncovered a path where we're calling libsolv on the full NVR as that's what included in the data that are passed to print_transaction() function. Extend the search criteria to also cover the canonical selection for resolving the NVR specified packages (similarly to what we've done in commit c86735) I sadly didn't hit this previously as I've this change applied locally when I was debugging https://pagure.io/modularity/fedmod/pull-request/113 and left it there when working on the commit 9b8b59. --- diff --git a/_fedmod/_depchase.py b/_fedmod/_depchase.py index 0583977..78df503 100644 --- a/_fedmod/_depchase.py +++ b/_fedmod/_depchase.py @@ -300,9 +300,11 @@ def print_reldeps(pool, pkg): def _get_rpm(pool, pkg): - sel = pool.select(pkg, - solv.Selection.SELECTION_NAME - | solv.Selection.SELECTION_DOTARCH) + search_criteria = (solv.Selection.SELECTION_NAME + | solv.Selection.SELECTION_DOTARCH) + if "." in pkg: + search_criteria |= solv.Selection.SELECTION_CANON + sel = pool.select(pkg, search_criteria) if sel.isempty(): raise RuntimeError("Couldn't find package {}".format(pkg)) found = sel.solvables()