From 4845207fd4b540efd7dfcb157eaa64a1a3f10ed9 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 2 Dec 2007 12:20:55 -0600 Subject: 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 --- src/pacman/conf.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/pacman/conf.h') diff --git a/src/pacman/conf.h b/src/pacman/conf.h index 01d69498..989fa2c8 100644 --- a/src/pacman/conf.h +++ b/src/pacman/conf.h @@ -24,7 +24,6 @@ #include typedef struct __config_t { - char *configfile; unsigned short op; unsigned short quiet; unsigned short verbose; @@ -34,10 +33,14 @@ typedef struct __config_t { unsigned short noconfirm; unsigned short noprogressbar; unsigned short logmask; - /* keep track if we had paths specified on command line */ - unsigned short have_root; - unsigned short have_dbpath; - unsigned short have_logfile; + /* unfortunately, we have to keep track of paths both here and in the library + * because they can come from both the command line or config file, and we + * need to ensure we get the order of preference right. */ + char *configfile; + char *rootdir; + char *dbpath; + char *logfile; + /* TODO how to handle cachedirs? */ unsigned short op_q_isfile; unsigned short op_q_info; -- cgit v1.2.3