summaryrefslogtreecommitdiff
path: root/src/pacman/conf.h
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-12-02 12:20:55 -0600
committerDan McGee <dan@archlinux.org>2007-12-02 12:20:55 -0600
commit4845207fd4b540efd7dfcb157eaa64a1a3f10ed9 (patch)
treeae73be869dfae4353586a4004cd95e03bd8d02e0 /src/pacman/conf.h
parent250331a636699561e1239e341f30f2adfebbcb43 (diff)
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.h')
-rw-r--r--src/pacman/conf.h13
1 files changed, 8 insertions, 5 deletions
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 <alpm.h>
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;