From 7108a9ad57743ffb37fef9915d913bde8cda3cac Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: May 15 2018 15:41:57 +0000 Subject: add mapping package/module for dependencies --- diff --git a/src/_fedmod/_depchase.py b/src/_fedmod/_depchase.py index dc69031..ce963d5 100644 --- a/src/_fedmod/_depchase.py +++ b/src/_fedmod/_depchase.py @@ -100,12 +100,13 @@ def _get_dependency_details(pool, transaction): return result -def print_transaction(details): +def print_transaction(details, pool): tb = smartcols.Table() tb.title = "DEPENDENCY INFORMATION" cl = tb.new_column("INFO") cl.tree = True cl_match = tb.new_column("MATCH") + cl_repo = tb.new_column("REPO") for p in sorted(details): ln = tb.new_line() ln[cl] = p @@ -123,6 +124,13 @@ def print_transaction(details): lnc = lnss first = False lnc[cl_match] = m + sel = pool.select(m, solv.Selection.SELECTION_CANON) + if sel.isempty(): + lnc[cl_repo] = "Unknown repo" + else: + s = sel.solvables() + assert len(s) == 1 + lnc[cl_repo] = str(s[0].repo) log.info(tb) FullInfo = collections.namedtuple('FullInfo', ['name', 'rpm', 'srpm', 'requires']) @@ -154,7 +162,7 @@ def _solve(solver, pkgnames, full_info=False): if log.getEffectiveLevel() <= logging.INFO or full_info: dep_details = _get_dependency_details(pool, solver.transaction()) if log.getEffectiveLevel() <= logging.INFO: - print_transaction(dep_details) + print_transaction(dep_details, pool) if full_info: result = []