summaryrefslogtreecommitdiff
path: root/src/update.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-04-07 09:57:42 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-04-07 10:49:51 +0200
commit944eae4b27d039608dd72b1d7b3ed015c20bdcc0 (patch)
tree7bf60e2d41308feb8e7b5af73e35eaf464821680 /src/update.c
parent7e3f4c3d7996811a37393514d6f0eaacae7178e2 (diff)
downloadapk-tools-944eae4b27d039608dd72b1d7b3ed015c20bdcc0.tar.gz
apk-tools-944eae4b27d039608dd72b1d7b3ed015c20bdcc0.tar.bz2
apk-tools-944eae4b27d039608dd72b1d7b3ed015c20bdcc0.tar.xz
apk-tools-944eae4b27d039608dd72b1d7b3ed015c20bdcc0.zip
update: return failure if any mirror update failed
fixes #4040
Diffstat (limited to 'src/update.c')
-rw-r--r--src/update.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/update.c b/src/update.c
index ed721be..84833ec 100644
--- a/src/update.c
+++ b/src/update.c
@@ -20,6 +20,7 @@ static int update_main(void *ctx, struct apk_database *db, struct apk_string_arr
{
struct apk_repository *repo;
int i;
+ char buf[32] = "OK:";
if (apk_verbosity < 1)
return 0;
@@ -35,10 +36,13 @@ static int update_main(void *ctx, struct apk_database *db, struct apk_string_arr
db->repos[i].url);
}
- apk_message("OK: %d distinct packages available",
+ if (db->repo_update_errors != 0)
+ snprintf(buf, sizeof(buf), "%d errors;",
+ db->repo_update_errors);
+ apk_message("%s %d distinct packages available", buf,
db->available.packages.num_items);
- return 0;
+ return db->repo_update_errors;
}
static struct apk_applet apk_update = {