update: better package database

This commit is contained in:
ngn
2024-08-15 02:16:16 +03:00
parent e0f0dec222
commit 472cb9004e
11 changed files with 424 additions and 371 deletions

View File

@ -55,13 +55,16 @@ bool lm_ctx_remove(lm_ctx_t *ctx, lm_entry_t *entry, lm_ctx_remove_callback_t ca
size_t total = 0, current = 0;
total = lm_database_files_count(ctx->db, entry);
pdebug(__func__, "removing %lu files", total);
while(lm_database_files_next(ctx->db, entry, &path, &hash, &in_keep)){
if(in_keep)
if(in_keep){
pdebug(__func__, "not removing file because it is set as keep: %s", path);
goto next;
}
fpath = join_alloc(ctx->root, path);
pdebug(__func__, "removing file %s (%s)", fpath, entry->name);
pdebug(__func__, "removing file %s (%s)", fpath, hash);
if(!exists(fpath, NULL)){
pdebug(__func__, "found file in database, but its not on the file system: %s", fpath);