diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-04-29 14:12:50 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2013-04-29 14:14:57 +0300 |
commit | 4c08eca3bb844ed51acab1461327f3dd01ce1866 (patch) | |
tree | a01825625b059e680b76b5f3d9cb69afcd9d360c | |
parent | 4d95266e4d64631d6659b78acc41f2b942f32a74 (diff) | |
download | apk-tools-4c08eca3bb844ed51acab1461327f3dd01ce1866.tar.gz apk-tools-4c08eca3bb844ed51acab1461327f3dd01ce1866.tar.bz2 apk-tools-4c08eca3bb844ed51acab1461327f3dd01ce1866.tar.xz apk-tools-4c08eca3bb844ed51acab1461327f3dd01ce1866.zip |
upgrade: handle solver failure gracefully
It is internal bug, but don't segfault on it. Fixes #1576.
-rw-r--r-- | src/upgrade.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/upgrade.c b/src/upgrade.c index 914f019..3b30fe3 100644 --- a/src/upgrade.c +++ b/src/upgrade.c @@ -54,7 +54,7 @@ int apk_do_self_upgrade(struct apk_database *db, unsigned short solver_flags) r = apk_solver_solve(db, 0, db->world, &solution, &changeset); if (r != 0) { - if (apk_flags & APK_FORCE) + if ((r > 0) && (apk_flags & APK_FORCE)) r = 0; else apk_solver_print_errors(db, solution, db->world, r); |