From d59d870574729c782783c91624f34cf580b25c96 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 27 Jun 2022 18:12:53 +0200 Subject: [PATCH] dnf-json: fix depsolve error handling When a DepsolveError exception occurs, the error message would print the packages in the request. When the request arguments changed, the error message handling wasn't updated and would fail to produce the correct error message. Compile a list of packages from all transactions and print them in the error message as a comma-separated list. --- dnf-json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dnf-json b/dnf-json index 84e6e718c4..f043516a73 100755 --- a/dnf-json +++ b/dnf-json @@ -212,9 +212,13 @@ def solve(request, cache_dir): } except dnf.exceptions.DepsolveError as e: printe("error depsolve") + # collect list of packages for error + pkgs = [] + for t in transactions: + pkgs.extend(t["package-specs"]) return None, { "kind": "DepsolveError", - "reason": f"There was a problem depsolving {arguments['package-specs']}: {e}" + "reason": f"There was a problem depsolving {', '.join(pkgs)}: {e}" } except dnf.exceptions.RepoError as e: return None, {