update: Don't abort on errors on check_manifests_uniqueness()

On error, return an error code instead of aborting. And handle error on
function call.
This commit is contained in:
Otavio Pontes
2018-07-13 17:34:17 -07:00
committed by Matthew Johnson
parent fe906d2b73
commit da16c15f0e
+5 -2
View File
@@ -65,7 +65,7 @@ static int check_manifests_uniqueness(int clrver, int mixver)
if (clearfull == NULL || mixerfull == NULL) {
fprintf(stderr, "Could not convert full manifest to array\n");
abort();
return -1;
}
int ret = enforce_compliant_manifest(mixerfull, clearfull, mixer->filecount, clear->filecount);
@@ -282,12 +282,15 @@ version_check:
// new mix version
check_mix_versions(&mix_current_version, &mix_server_version, path_prefix);
ret = check_manifests_uniqueness(server_version, mix_server_version);
if (ret) {
if (ret > 0) {
printf("\n\t!! %i collisions were found between mix and upstream, please re-create mix !!\n", ret);
if (!allow_mix_collisions) {
ret = EXIT_FAILURE;
goto clean_curl;
}
} else if (ret < 0) {
ret = EXIT_FAILURE;
goto clean_curl;
}
goto version_check;