update: better handling of the keep files

This commit is contained in:
ngn
2024-08-04 13:11:25 +03:00
parent b27e31c66c
commit d2d6679060
19 changed files with 128 additions and 43 deletions

View File

@ -12,7 +12,7 @@ int main(int argc, char *argv[]) {
int ret = EXIT_FAILURE;
char pooldir[strlen(TEMP_DIR) + 10];
sprintf(pooldir, "%s/%s", TEMP_DIR, "pool");
sprintf(pooldir, "%s/%s", DATA_DIR, "pool");
if (argc != 4) {
printf("usage: %s <package name> <pool name> <pool url>\n", argv[0]);

View File

@ -17,11 +17,19 @@ int main(int argc, char *argv[]) {
return ret;
}
char pooldir[strlen(TEMP_DIR) + 10];
sprintf(pooldir, "%s/%s", DATA_DIR, "pool");
if (!lm_ctx_init(&ctx, ROOT_DIR, TEMP_DIR, DATA_DIR)) {
printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error());
goto end;
}
if (lm_ctx_pool_add(&ctx, argv[1], argv[2], pooldir) == NULL) {
printf("failed to add pool: %s (%d)\n", lm_strerror(), lm_error());
goto end;
}
lm_ctx_ping(&ctx, NULL, NULL);
lm_ctx_sync(&ctx, true, NULL, NULL);