summaryrefslogtreecommitdiff
path: root/lib/libalpm/handle.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-10-10 20:41:35 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-10-10 20:41:35 +0000
commit609466fdeb614c8a7a7bb6b5e9921d2fd2fde17f (patch)
tree95dca1525ffc5ab45ca877f6f6c78f51c9f31efd /lib/libalpm/handle.c
parentb817883cddb8817f49e234d321af289c1e4f68b8 (diff)
downloadpacman-609466fdeb614c8a7a7bb6b5e9921d2fd2fde17f.tar.xz
added PM_OPT_CACHEDIR library option
Diffstat (limited to 'lib/libalpm/handle.c')
-rw-r--r--lib/libalpm/handle.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 8567b87d..568f0d28 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -109,6 +109,13 @@ int handle_set_option(pmhandle_t *handle, unsigned char val, unsigned long data)
handle->dbpath = strdup((data && strlen((char *)data) != 0) ? (char *)data : PM_DBPATH);
_alpm_log(PM_LOG_FLOW2, "PM_OPT_DBPATH set to '%s'", handle->dbpath);
break;
+ case PM_OPT_CACHEDIR:
+ if(handle->cachedir) {
+ FREE(handle->cachedir);
+ }
+ handle->cachedir = strdup((data && strlen((char *)data) != 0) ? (char *)data : PM_CACHEDIR);
+ _alpm_log(PM_LOG_FLOW2, "PM_OPT_CACHEDIR set to '%s'", handle->cachedir);
+ break;
case PM_OPT_LOGFILE:
if((char *)data == NULL || handle->uid != 0) {
return(0);
@@ -194,6 +201,7 @@ int handle_get_option(pmhandle_t *handle, unsigned char val, long *data)
switch(val) {
case PM_OPT_ROOT: *data = (long)handle->root; break;
case PM_OPT_DBPATH: *data = (long)handle->dbpath; break;
+ case PM_OPT_CACHEDIR: *data = (long)handle->cachedir; break;
case PM_OPT_LOCALDB: *data = (long)handle->db_local; break;
case PM_OPT_SYNCDB: *data = (long)handle->dbs_sync; break;
case PM_OPT_LOGFILE: *data = (long)handle->logfile; break;