From: Michael Tremer Date: Thu, 13 May 2021 18:09:42 +0000 (+0000) Subject: transaction: Show correct package order for upgrades/downgrades X-Git-Tag: 0.9.28~1285^2~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23c48febcb7046a4bfec79e93c6e2d0da2756f8f;p=pakfire.git transaction: Show correct package order for upgrades/downgrades Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/transaction.c b/src/libpakfire/transaction.c index 0e05873d8..b5284bc84 100644 --- a/src/libpakfire/transaction.c +++ b/src/libpakfire/transaction.c @@ -245,11 +245,11 @@ static void pakfire_transaction_add_package(char** str, size_t width, PakfirePac } static void pakfire_transaction_add_package_change(char** str, size_t width, - PakfirePackage pkg1, PakfirePackage pkg2) { + PakfirePackage old_pkg, PakfirePackage new_pkg) { // Print the new package first - pakfire_transaction_add_package(str, width, pkg1); + pakfire_transaction_add_package(str, width, new_pkg); - asprintf(str, "%s --> %s\n", *str, pakfire_package_get_nevra(pkg2)); + asprintf(str, "%s --> %s\n", *str, pakfire_package_get_nevra(old_pkg)); } static void pakfire_transaction_add_separator(char** str, size_t width) { @@ -384,27 +384,27 @@ PAKFIRE_EXPORT char* pakfire_transaction_dump(struct pakfire_transaction* transa // List all packages for (int j = 0; j < pkgs.count; j++) { - PakfirePackage pkg1 = pakfire_package_create_from_solvable( + PakfirePackage old_pkg = pakfire_package_create_from_solvable( transaction->pakfire, pkgs.elements[j]); - PakfirePackage pkg2 = NULL; + PakfirePackage new_pkg = NULL; switch (class) { case SOLVER_TRANSACTION_UPGRADED: case SOLVER_TRANSACTION_DOWNGRADED: - pkg2 = pakfire_package_create_from_solvable(transaction->pakfire, + new_pkg = pakfire_package_create_from_solvable(transaction->pakfire, transaction_obs_pkg(transaction->transaction, pkgs.elements[j])); - pakfire_transaction_add_package_change(&string, width, pkg1, pkg2); + pakfire_transaction_add_package_change(&string, width, old_pkg, new_pkg); break; default: - pakfire_transaction_add_package(&string, width, pkg1); + pakfire_transaction_add_package(&string, width, old_pkg); break; } - pakfire_package_unref(pkg1); - if (pkg2) - pakfire_package_unref(pkg2); + pakfire_package_unref(old_pkg); + if (new_pkg) + pakfire_package_unref(new_pkg); } // Newline