From 40f6720a3ffd448bd338412cf975befc71461abd Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Wed, 28 Dec 2022 14:42:23 +0200 Subject: 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 --- src/app_upgrade.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/app_upgrade.c') 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) { -- cgit v1.2.3-70-g09d2