]> git.ipfire.org Git - pakfire.git/commitdiff
transaction: Show which step, action and package failed
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 Mar 2023 15:58:08 +0000 (15:58 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 Mar 2023 15:58:37 +0000 (15:58 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/transaction.c

index 11cd89989136dbe474e1837671786b404ac27e3e..160c74aaa31de93893125902c17f984ae61bad0c 100644 (file)
@@ -829,10 +829,10 @@ static int pakfire_transaction_run_step(struct pakfire_transaction* transaction,
                return 1;
        }
 
-       DEBUG(transaction->pakfire, "Running %s for %s\n",
-               pakfire_action_type_string(action), pakfire_package_get_string(pkg, PAKFIRE_PKG_NEVRA));
+       const char* nevra = pakfire_package_get_string(pkg, PAKFIRE_PKG_NEVRA);
+       const enum pakfire_steps type = pakfire_transaction_get_step_type(transaction, pkg);
 
-       enum pakfire_steps type = pakfire_transaction_get_step_type(transaction, pkg);
+       DEBUG(transaction->pakfire, "Running %s for %s\n", pakfire_action_type_string(action), nevra);
 
        int r = 0;
        switch (action) {
@@ -999,7 +999,8 @@ static int pakfire_transaction_run_step(struct pakfire_transaction* transaction,
        }
 
        if (r)
-               ERROR(transaction->pakfire, "Step has failed: %s\n", strerror(r));
+               ERROR(transaction->pakfire, "Step %s (%d) for %s has failed: %m\n",
+                       pakfire_action_type_string(action), type, nevra);
 
        return r;
 }