summaryrefslogtreecommitdiffstats
path: root/src/pacman/conf.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-12-02 19:20:55 +0100
committerDan McGee <dan@archlinux.org>2007-12-02 19:20:55 +0100
commit4845207fd4b540efd7dfcb157eaa64a1a3f10ed9 (patch)
treeae73be869dfae4353586a4004cd95e03bd8d02e0 /src/pacman/conf.c
parent250331a636699561e1239e341f30f2adfebbcb43 (diff)
downloadpacman-4845207fd4b540efd7dfcb157eaa64a1a3f10ed9.tar.gz
pacman-4845207fd4b540efd7dfcb157eaa64a1a3f10ed9.tar.xz
Make pacman path handling (hopefully) a bit more intuitive
I made pacman path handling a bit odd with my rootdir changes a while back in order to increase flexability. However, it had a bit of a drawback in that dbpath/logfile/etc. would not default to being under the rootdir if that was the only parameter you specified in the config file or on the command line. (Note: logfile handling was always broken due to the explicit logfile line required in config files) Pacman now works as follows: if a rootdir is specified but not dbpath or logfile: attempt to place the logfile and dbpath in their default locations under root if an explicit dbpath/logfile is specified: interpret these as absolute paths, regardless of the rootdir setting if nothing is specified: fall back to configured defaults Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/conf.c')
-rw-r--r--src/pacman/conf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 9940a133..743f8330 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -44,6 +44,9 @@ config_t *config_new(void)
newconfig->logmask = PM_LOG_ERROR | PM_LOG_WARNING;
/* CONFFILE is defined at compile-time */
newconfig->configfile = strdup(CONFFILE);
+ newconfig->rootdir = NULL;
+ newconfig->dbpath = NULL;
+ newconfig->logfile = NULL;
return(newconfig);
}
@@ -55,6 +58,9 @@ int config_free(config_t *oldconfig)
}
free(oldconfig->configfile);
+ free(oldconfig->rootdir);
+ free(oldconfig->dbpath);
+ free(oldconfig->logfile);
free(oldconfig);
oldconfig = NULL;