summaryrefslogtreecommitdiff
path: root/src/app_upgrade.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2022-12-28 14:42:23 +0200
committerTimo Teräs <timo.teras@iki.fi>2022-12-28 14:59:32 +0200
commit40f6720a3ffd448bd338412cf975befc71461abd (patch)
treec92a833ffbced3e683fab1a8acc1e28d7c915c6f /src/app_upgrade.c
parent22cc01645d93b6cf97e8d154f04c7ce3c5d74597 (diff)
downloadapk-tools-40f6720a3ffd448bd338412cf975befc71461abd.tar.gz
apk-tools-40f6720a3ffd448bd338412cf975befc71461abd.tar.bz2
apk-tools-40f6720a3ffd448bd338412cf975befc71461abd.tar.xz
apk-tools-40f6720a3ffd448bd338412cf975befc71461abd.zip
cache, upgrade: do not continue if repositories have issues
There are subtle issues where solving fails with --available, and install_if rules if the repository indexes are not available. Also it can be considered upgrade failure if index update failed. Abort cache download, cache sync and upgrade operations early in the above mentioned cases. Also document side effects of --simulate that might affect upgrade. fixes #10726, #10764
Diffstat (limited to 'src/app_upgrade.c')
-rw-r--r--src/app_upgrade.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/app_upgrade.c b/src/app_upgrade.c
index 8645d21..bc6ccb1 100644
--- a/src/app_upgrade.c
+++ b/src/app_upgrade.c
@@ -163,6 +163,10 @@ static int upgrade_main(void *ctx, struct apk_database *db, struct apk_string_ar
"Use --force-broken-world to override.");
return -1;
}
+ if (db->repositories.stale || db->repositories.unavailable) {
+ apk_error("Not continuing due to stale/unavailable repositories.");
+ return -1;
+ }
solver_flags = APK_SOLVERF_UPGRADE | uctx->solver_flags;
if (!uctx->no_self_upgrade && !args->num) {