diff options
author | Aurelien Foret <aurelien@archlinux.org> | 2005-03-25 20:29:35 +0000 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2005-03-25 20:29:35 +0000 |
commit | e010e1bba62b3e542740ebe63e640048a9052729 (patch) | |
tree | f30da2be46d3e8367192477a753544dd4b67ed9f /src | |
parent | 3b229d3a1af61dbb2975c69152b83223608f51b5 (diff) | |
download | pacman-e010e1bba62b3e542740ebe63e640048a9052729.tar.xz |
replaced hardcoded references to the cache by CACHEDIR
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/sync.c | 7 |
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) { |