summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app_cache.c10
-rw-r--r--src/app_upgrade.c4
2 files changed, 13 insertions, 1 deletions
diff --git a/src/app_cache.c b/src/app_cache.c
index 3a68938..09d9adf 100644
--- a/src/app_cache.c
+++ b/src/app_cache.c
@@ -198,11 +198,19 @@ static int cache_main(void *ctx, struct apk_database *db, struct apk_string_arra
return -EINVAL;
if (!apk_db_cache_active(db)) {
- apk_error("Package cache is not enabled.\n");
+ apk_error("Package cache is not enabled.");
r = 2;
goto err;
}
+ if ((actions & CACHE_DOWNLOAD) && (cctx->solver_flags || cctx->add_dependencies)) {
+ if (db->repositories.stale || db->repositories.unavailable) {
+ apk_error("Not continuing due to stale/unavailable repositories.");
+ r = 3;
+ goto err;
+ }
+ }
+
if (r == 0 && (actions & CACHE_CLEAN))
r = cache_clean(db);
if (r == 0 && (actions & CACHE_DOWNLOAD))
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) {