From 4c08eca3bb844ed51acab1461327f3dd01ce1866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Mon, 29 Apr 2013 14:12:50 +0300 Subject: [PATCH] upgrade: handle solver failure gracefully It is internal bug, but don't segfault on it. Fixes #1576. --- src/upgrade.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);