summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-25 20:29:35 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-03-25 20:29:35 +0000
commite010e1bba62b3e542740ebe63e640048a9052729 (patch)
treef30da2be46d3e8367192477a753544dd4b67ed9f
parent3b229d3a1af61dbb2975c69152b83223608f51b5 (diff)
downloadpacman-e010e1bba62b3e542740ebe63e640048a9052729.tar.xz
replaced hardcoded references to the cache by CACHEDIR
-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) {