summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pacman/sync.c7
1 files 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) {