Skip to content

Commit

Permalink
repo: return error code if no successful mirrors
Browse files Browse the repository at this point in the history
Should preserve the "its okay for a mirror to fail" behavior, but still
catch in the case that it wasn't able to check any mirrors at all.

Closes void-linux#293.
  • Loading branch information
abenson committed Jan 6, 2021
1 parent 6518107 commit c891388
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/rpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ int
xbps_rpool_sync(struct xbps_handle *xhp, const char *uri)
{
const char *repouri = NULL;
int repocount = 0;

for (unsigned int i = 0; i < xbps_array_count(xhp->repositories); i++) {
xbps_array_get_cstring_nocopy(xhp->repositories, i, &repouri);
Expand All @@ -75,7 +76,11 @@ xbps_rpool_sync(struct xbps_handle *xhp, const char *uri)
xbps_fetch_error_string());
continue;
}
repocount++;
}

if(repocount == 0)
return -1;
return 0;
}

Expand Down

0 comments on commit c891388

Please sign in to comment.