mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Skip special files when cleaning package cache
Ignore *.sig, *.db*, and *.src.tar* when cleaning the package cache. Fixes FS#25166. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
ff58e5cb2d
commit
47d0df6c10
@ -28,6 +28,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <fnmatch.h>
|
||||||
|
|
||||||
#include <alpm.h>
|
#include <alpm.h>
|
||||||
#include <alpm_list.h>
|
#include <alpm_list.h>
|
||||||
@ -224,6 +225,22 @@ static int sync_cleancache(int level)
|
|||||||
if(strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) {
|
if(strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* skip signature files - they are removed with their package file */
|
||||||
|
if(fnmatch("*.sig", ent->d_name, 0) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* skip package database within the cache directory */
|
||||||
|
if(fnmatch("*.db*", ent->d_name, 0) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* skip source packages within the cache directory */
|
||||||
|
if(fnmatch("*.src.tar*", ent->d_name, 0) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* build the full filepath */
|
/* build the full filepath */
|
||||||
snprintf(path, PATH_MAX, "%s%s", cachedir, ent->d_name);
|
snprintf(path, PATH_MAX, "%s%s", cachedir, ent->d_name);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user