From: Michael Tremer Date: Mon, 19 Apr 2021 16:45:39 +0000 (+0000) Subject: pakfire: Add more error messages when reading configuration fails X-Git-Tag: 0.9.28~1285^2~318 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c68ccf20060eef3128d4a3b9acbafdfbb52c576;p=pakfire.git pakfire: Add more error messages when reading configuration fails Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index 8c3f10b7d..8109cb833 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -406,6 +406,8 @@ static int pakfire_read_repo_config(Pakfire pakfire) { if (r < 0) return 1; + DEBUG(pakfire, "Reading repository configuration from %s\n", path); + char* paths[2] = { path, NULL, }; @@ -441,6 +443,9 @@ static int pakfire_read_repo_config(Pakfire pakfire) { } } + // Success + r = 0; + ERROR: if (d) fts_close(d); @@ -517,13 +522,16 @@ static int pakfire_read_config(Pakfire pakfire, const char* path) { if (*default_path && errno == ENOENT) return 0; + ERROR(pakfire, "Could not open configuration file %s: %s\n", path, strerror(errno)); return 1; } // Read configuration from file int r = pakfire_config_read(pakfire->config, f); - if (r) + if (r) { + ERROR(pakfire, "Could not parse configuration file %s: %s\n", path, strerror(errno)); goto ERROR; + } // Import distro configuration r = pakfire_config_import_distro(pakfire);