summaryrefslogtreecommitdiff
path: root/src/upgrade.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-01-17 14:46:39 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-01-17 14:48:22 +0200
commitb3df78ed03b3739d01220f9bf2f00ab8df61425f (patch)
tree3e06ec9de1b517fba8bdee5c3a234193e0a775b9 /src/upgrade.c
parenteaaba3ee893c7fb3c5a258f0609d8ab6e4637804 (diff)
downloadapk-tools-b3df78ed03b3739d01220f9bf2f00ab8df61425f.tar.gz
apk-tools-b3df78ed03b3739d01220f9bf2f00ab8df61425f.tar.bz2
apk-tools-b3df78ed03b3739d01220f9bf2f00ab8df61425f.tar.xz
apk-tools-b3df78ed03b3739d01220f9bf2f00ab8df61425f.zip
solver, upgrade: properly detect missing repository tags
* upgrade needs explicit check so we don't try self-upgrade (which would print additional messages on screen) * add can fix problems, so check against the new world * merge the code in few places
Diffstat (limited to 'src/upgrade.c')
-rw-r--r--src/upgrade.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/upgrade.c b/src/upgrade.c
index 6ce851b..497fc54 100644
--- a/src/upgrade.c
+++ b/src/upgrade.c
@@ -97,6 +97,11 @@ static int upgrade_main(void *ctx, struct apk_database *db, int argc, char **arg
struct apk_dependency_array *world = NULL;
int i, r;
+ if (apk_db_check_world(db, db->world) != 0) {
+ apk_error("Not continuing with upgrade due to missing repository tags. Use --force to override.");
+ return -1;
+ }
+
solver_flags = APK_SOLVERF_UPGRADE | uctx->solver_flags;
if (!uctx->no_self_upgrade) {
r = apk_do_self_upgrade(db, solver_flags);