From feb152d78c60731df19eb0041e0d22494afe9e09 Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Thu, 20 Oct 2005 20:44:14 +0000 Subject: added a default cachedir --- src/pacman/conf.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/pacman/conf.c') diff --git a/src/pacman/conf.c b/src/pacman/conf.c index cf3ca9c6..a62ef609 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -35,6 +35,7 @@ #define min(X, Y) ((X) < (Y) ? (X) : (Y)) extern char *pmo_dbpath; +extern char *pmo_cachedir; extern list_t *pmo_holdpkg; extern char *pmo_proxyhost; extern unsigned short pmo_proxyport; @@ -214,6 +215,14 @@ int parseconfig(char *file) FREE(pmo_dbpath); pmo_dbpath = strdup(ptr); vprint("config: dbpath: %s\n", ptr); + } else if(!strcmp(key, "CACHEDIR")) { + /* shave off the leading slash, if there is one */ + if(*ptr == '/') { + ptr++; + } + FREE(pmo_cachedir); + pmo_cachedir = strdup(ptr); + vprint("config: cachedir: %s\n", ptr); } else if (!strcmp(key, "LOGFILE")) { if(alpm_set_option(PM_OPT_LOGFILE, (long)ptr) == -1) { ERR(NL, "failed to set option LOGFILE (%s)\n", alpm_strerror(pm_errno)); -- cgit v1.2.3-24-g4f1b