summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-02-15 19:40:22 -0600
committerDan McGee <dan@archlinux.org>2008-02-15 19:40:22 -0600
commit6b07b5d34512ef361ebf04395f07965cb80d0ec3 (patch)
treed67f27a25aeae00dedf5c6fab176576c06d1f5d9 /src
parenta16608c6100e8620c03c94e34bb47256c2f5ee32 (diff)
parentbe95e4d8a008662eb0e19a3186953511551acec1 (diff)
downloadpacman-6b07b5d34512ef361ebf04395f07965cb80d0ec3.tar.xz
Merge branch 'maint'
Conflicts: lib/libalpm/be_files.c lib/libalpm/package.c
Diffstat (limited to 'src')
-rw-r--r--src/pacman/pacman.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 7d584955..f1853203 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -231,11 +231,11 @@ static void cleanup(int signum)
exit(signum);
}
-/** Sets all libalpm required paths in one go. Called after the command line and
- * inital config file parsing. Once this is complete, we can see if any paths were
- * defined. If a rootdir was defined and nothing else, we want all of our paths to
- * live under the rootdir that was specified. Safe to call multiple times (will only
- * do anything the first time).
+/** Sets all libalpm required paths in one go. Called after the command line
+ * and inital config file parsing. Once this is complete, we can see if any
+ * paths were defined. If a rootdir was defined and nothing else, we want all
+ * of our paths to live under the rootdir that was specified. Safe to call
+ * multiple times (will only do anything the first time).
*/
static void setlibpaths(void)
{
@@ -244,6 +244,8 @@ static void setlibpaths(void)
int ret = 0;
pm_printf(PM_LOG_DEBUG, "setlibpaths() called\n");
+ /* Configure root path first. If it is set and dbpath/logfile were not
+ * set, then set those as well to reside under the root. */
if(config->rootdir) {
char path[PATH_MAX];
ret = alpm_option_set_root(config->rootdir);
@@ -258,10 +260,12 @@ static void setlibpaths(void)
}
if(!config->logfile) {
snprintf(path, PATH_MAX, "%s%s", alpm_option_get_root(), LOGFILE);
- ret = alpm_option_set_dbpath(path);
config->logfile = strdup(path);
}
}
+ /* Set other paths if they were configured. Note that unless rootdir
+ * was left undefined, these two paths (dbpath and logfile) will have
+ * been set locally above, so the if cases below will now trigger. */
if(config->dbpath) {
ret = alpm_option_set_dbpath(config->dbpath);
if(ret != 0) {