summaryrefslogtreecommitdiff
path: root/src/upgrade.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-04-29 14:12:50 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-04-29 14:14:57 +0300
commit4c08eca3bb844ed51acab1461327f3dd01ce1866 (patch)
treea01825625b059e680b76b5f3d9cb69afcd9d360c /src/upgrade.c
parent4d95266e4d64631d6659b78acc41f2b942f32a74 (diff)
downloadapk-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.
Diffstat (limited to 'src/upgrade.c')
-rw-r--r--src/upgrade.c2
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);