Add pacman support for .files databases
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
289fdf0d1d
commit
b0dac754d2
2 changed files with 7 additions and 3 deletions
|
@ -750,7 +750,7 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
|
||||||
fname = malloc(len + 1);
|
fname = malloc(len + 1);
|
||||||
memcpy(fname, filename, len);
|
memcpy(fname, filename, len);
|
||||||
/* strip package or DB extension for cleaner look */
|
/* 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 */
|
/* tack on a .sig suffix for signatures */
|
||||||
if(memcmp(&filename[len - 4], ".sig", 4) == 0) {
|
if(memcmp(&filename[len - 4], ".sig", 4) == 0) {
|
||||||
memcpy(p, ".sig", 4);
|
memcpy(p, ".sig", 4);
|
||||||
|
|
|
@ -102,6 +102,10 @@ static int sync_cleandb(const char *dbpath)
|
||||||
dbname = strndup(dname, len - 3);
|
dbname = strndup(dname, len - 3);
|
||||||
} else if(len > 7 && strcmp(dname + len - 7, ".db.sig") == 0) {
|
} else if(len > 7 && strcmp(dname + len - 7, ".db.sig") == 0) {
|
||||||
dbname = strndup(dname, len - 7);
|
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 {
|
} else {
|
||||||
ret += unlink_verbose(path, 0);
|
ret += unlink_verbose(path, 0);
|
||||||
continue;
|
continue;
|
||||||
|
@ -215,8 +219,8 @@ static int sync_cleancache(int level)
|
||||||
static const char *const glob_skips[] = {
|
static const char *const glob_skips[] = {
|
||||||
/* skip signature files - they are removed with their package file */
|
/* skip signature files - they are removed with their package file */
|
||||||
"*.sig",
|
"*.sig",
|
||||||
/* skip package database within the cache directory */
|
/* skip package databases within the cache directory */
|
||||||
"*.db*",
|
"*.db*", "*.files*",
|
||||||
/* skip source packages within the cache directory */
|
/* skip source packages within the cache directory */
|
||||||
"*.src.tar.*",
|
"*.src.tar.*",
|
||||||
/* skip package deltas, we aren't smart enough to clean these yet */
|
/* skip package deltas, we aren't smart enough to clean these yet */
|
||||||
|
|
Loading…
Add table
Reference in a new issue