summaryrefslogtreecommitdiffstats
path: root/src/fix.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-06-01 11:49:32 +0300
committerTimo Teräs <timo.teras@iki.fi>2010-06-01 11:49:32 +0300
commit038b672061919296b68b83a1ccead9c31b650c6c (patch)
tree277f16e61f937139d61e36b2d7b468ddbb87f536 /src/fix.c
parent2165547badcc26be1a0fcb2944f11c0bfea25d8a (diff)
downloadapk-tools-038b672061919296b68b83a1ccead9c31b650c6c.tar.bz2
apk-tools-038b672061919296b68b83a1ccead9c31b650c6c.tar.xz
state: improve error messages from dependency failures
Print more information why installation changeset calculation failed. Fixes #187.
Diffstat (limited to 'src/fix.c')
-rw-r--r--src/fix.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/fix.c b/src/fix.c
index 5c2ff54..f84fbc8 100644
--- a/src/fix.c
+++ b/src/fix.c
@@ -84,14 +84,13 @@ static int fix_main(void *pctx, struct apk_database *db, int argc, char **argv)
name->flags |= APK_NAME_REINSTALL;
}
- for (i = 0; i < argc; i++) {
- r = apk_state_lock_dependency(state, &deps[i]);
- if (r != 0) {
- if (!(apk_flags & APK_FORCE))
- goto err;
- }
- }
- r = apk_state_commit(state, db);
+ for (i = 0; i < argc; i++)
+ r |= apk_state_lock_dependency(state, &deps[i]);
+
+ if (r == 0 || (apk_flags & APK_FORCE))
+ r = apk_state_commit(state, db);
+ else
+ apk_state_print_errors(state);
err:
if (r != 0 && i < argc)
apk_error("Error while processing '%s'", argv[i]);