From b0dac754d27b45e4346b010e674f7faa466e0025 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Wed, 17 Jun 2015 22:27:50 +1000 Subject: Add pacman support for .files databases Signed-off-by: Allan McRae --- src/pacman/callback.c | 2 +- src/pacman/sync.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 1f086755..9260ece9 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -750,7 +750,7 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total) fname = malloc(len + 1); memcpy(fname, filename, len); /* strip package or DB extension for cleaner look */ - if((p = strstr(fname, ".pkg")) || (p = strstr(fname, ".db"))) { + if((p = strstr(fname, ".pkg")) || (p = strstr(fname, ".db")) || (p = strstr(fname, ".files"))) { /* tack on a .sig suffix for signatures */ if(memcmp(&filename[len - 4], ".sig", 4) == 0) { memcpy(p, ".sig", 4); diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 9dbaac80..f28ffbd9 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -102,6 +102,10 @@ static int sync_cleandb(const char *dbpath) dbname = strndup(dname, len - 3); } else if(len > 7 && strcmp(dname + len - 7, ".db.sig") == 0) { dbname = strndup(dname, len - 7); + } else if(len > 6 && strcmp(dname + len - 6, ".files") == 0) { + dbname = strndup(dname, len - 6); + } else if(len > 6 && strcmp(dname + len - 6, ".files.sig") == 0) { + dbname = strndup(dname, len - 10); } else { ret += unlink_verbose(path, 0); continue; @@ -215,8 +219,8 @@ static int sync_cleancache(int level) static const char *const glob_skips[] = { /* skip signature files - they are removed with their package file */ "*.sig", - /* skip package database within the cache directory */ - "*.db*", + /* skip package databases within the cache directory */ + "*.db*", "*.files*", /* skip source packages within the cache directory */ "*.src.tar.*", /* skip package deltas, we aren't smart enough to clean these yet */ -- cgit v1.2.3-70-g09d2