summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-06-04 10:19:28 -0400
committerDan McGee <dan@archlinux.org>2007-06-04 17:00:30 -0400
commita094deacf4f6abbef10c6acf38190d4fa9d34f0e (patch)
tree3a955b25ffc6db5c87e78e54c11d9368493901ab /lib/libalpm
parent029a8a9d44c6d6c9e86671e23b3d20018d8821e0 (diff)
downloadpacman-a094deacf4f6abbef10c6acf38190d4fa9d34f0e.tar.xz
Start moving hardcoded paths out of libalpm
Move the defaults for RootDir, CacheDir, DBPath, and LockFile into pacman.conf, just as LogFile was done before. Add a section to alpm_parse_config to look for a LockFile directive. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/alpm.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 33270149..0d5655e6 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -1025,29 +1025,20 @@ int SYMEXPORT alpm_parse_config(char *file, alpm_cb_db_register callback, const
alpm_option_add_holdpkg(p);
_alpm_log(PM_LOG_DEBUG, _("config: holdpkg: %s"), p);
} else if(strcmp(origkey, "DBPath") == 0 || strcmp(key, "DBPATH") == 0) {
- /* shave off the leading slash, if there is one */
- if(*ptr == '/') {
- ptr++;
- }
alpm_option_set_dbpath(ptr);
_alpm_log(PM_LOG_DEBUG, _("config: dbpath: %s"), ptr);
} else if(strcmp(origkey, "CacheDir") == 0 || strcmp(key, "CACHEDIR") == 0) {
- /* shave off the leading slash, if there is one */
- if(*ptr == '/') {
- ptr++;
- }
alpm_option_set_cachedir(ptr);
_alpm_log(PM_LOG_DEBUG, _("config: cachedir: %s"), ptr);
} else if(strcmp(origkey, "RootDir") == 0 || strcmp(key, "ROOTDIR") == 0) {
- /* shave off the leading slash, if there is one */
- if(*ptr == '/') {
- ptr++;
- }
alpm_option_set_root(ptr);
_alpm_log(PM_LOG_DEBUG, _("config: rootdir: %s"), ptr);
} else if (strcmp(origkey, "LogFile") == 0 || strcmp(key, "LOGFILE") == 0) {
alpm_option_set_logfile(ptr);
_alpm_log(PM_LOG_DEBUG, _("config: logfile: %s"), ptr);
+ } else if (strcmp(origkey, "LockFile") == 0 || strcmp(key, "LOCKFILE") == 0) {
+ alpm_option_set_lockfile(ptr);
+ _alpm_log(PM_LOG_DEBUG, _("config: lockfile: %s"), ptr);
} else if (strcmp(origkey, "XferCommand") == 0 || strcmp(key, "XFERCOMMAND") == 0) {
alpm_option_set_xfercommand(ptr);
_alpm_log(PM_LOG_DEBUG, _("config: xfercommand: %s"), ptr);