From 217bd310b9da9ea39e0ff41473b27b0b2fc1d5e8 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 10 Dec 2019 10:14:07 -0500 Subject: Start implementing configuration --- spm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spm.c') diff --git a/spm.c b/spm.c index 3c18cf9..1cfc737 100644 --- a/spm.c +++ b/spm.c @@ -1191,6 +1191,15 @@ int install(const char *destroot, const char *_package) { free(ucd); } +int init_config_global() { + SPM_GLOBAL.user_config_basedir = get_user_conf_dir(); + SPM_GLOBAL.user_config_file = get_user_config_file(); + SPM_GLOBAL.package_dir = realpath(PKG_DIR, NULL); + if (SPM_GLOBAL.user_config_file) { + config_read(SPM_GLOBAL.user_config_file); + } +} + int main(int argc, char *argv[]) { // not much to see here yet // at the moment this will all be random tests, for better or worse -- cgit