msk: complain if no remotes succeeded
This commit is contained in:
parent
2834bb9ef3
commit
b25b8242b0
@ -151,6 +151,8 @@ static int update_stores(int argc, char * argv[]) {
|
||||
confreader_t * manifest_out = confreader_create_empty();
|
||||
hashmap_t * remotes = hashmap_get(msk_config->sections, "remotes");
|
||||
|
||||
int one_success = 0;
|
||||
|
||||
char * order = strdup(confreader_getd(msk_config, "", "remote_order", ""));
|
||||
char * save;
|
||||
char * tok = strtok_r(order, ",", &save);
|
||||
@ -207,11 +209,18 @@ static int update_stores(int argc, char * argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
one_success = 1;
|
||||
|
||||
_next:
|
||||
tok = strtok_r(NULL, " ", &save);
|
||||
} while (tok);
|
||||
free(order);
|
||||
|
||||
if (!one_success) {
|
||||
fprintf(stderr, "\033[1;31merror\033[0m: no remote succeeded, no packages are available\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return confreader_write(manifest_out, VAR_PATH "/manifest");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user