new: cleaning up functions, base implementation of install function

This commit is contained in:
ngn
2024-07-04 03:12:33 +03:00
parent 43cf7d26c8
commit 38b99eda79
25 changed files with 568 additions and 253 deletions

View File

@ -30,13 +30,8 @@ int main(int argc, char *argv[]) {
lm_ctx_pool_get_info(&ctx, true, true, NULL, NULL);
lm_ctx_pool_get_list(&ctx, true, true, NULL, NULL);
if (lm_ctx_package_get(&ctx, "which", NULL) == NULL) {
printf("failed to get the package: %s (%d)\n", lm_strerror(), lm_error());
goto end;
}
if (!lm_ctx_package_verify(&ctx, "which", NULL)) {
printf("failed to verify package: %s (%d)\n", lm_strerror(), lm_error());
if(!lm_ctx_install(&ctx, "which")){
printf("failed to install the package: %s (%d)\n", lm_strerror(), lm_error());
goto end;
}