[pacman-dev] [PATCH 06/13] Add pacman support for .files databases

Allan McRae allan at archlinux.org
Sat Jun 20 07:42:19 UTC 2015


Signed-off-by: Allan McRae <allan at archlinux.org>
---
 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 1f08675..9260ece 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 c42c38d..4ed36ca 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -104,6 +104,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;
@@ -217,8 +221,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 */
-- 
2.4.4


More information about the pacman-dev mailing list