From e010e1bba62b3e542740ebe63e640048a9052729 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Fri, 25 Mar 2005 20:29:35 +0000 Subject: replaced hardcoded references to the cache by CACHEDIR --- src/pacman/sync.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pacman/sync.c b/src/pacman/sync.c index c9c1b931..62394780 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -69,9 +69,12 @@ static int sync_cleancache(int level) list_t *cache = NULL; list_t *clean = NULL; list_t *i, *j; + char dirpath[PATH_MAX]; + + snprintf(dirpath, PATH_MAX, "%s"CACHEDIR, root); printf("removing old packages from cache... "); - dir = opendir("/var/cache/pacman/pkg"); + dir = opendir(dirpath); if(dir == NULL) { fprintf(stderr, "error: could not access cache directory\n"); return(1); @@ -688,7 +691,7 @@ int pacman_sync(list_t *targets) group sync records by repository and download */ alpm_get_option(PM_OPT_ROOT, (long *)&root); - snprintf(ldir, PATH_MAX, "%svar/cache/pacman/pkg", root); + snprintf(ldir, PATH_MAX, "%s"CACHEDIR, root); while(!done) { if(current) { -- cgit v1.2.3-54-g00ecf