]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Add more error messages when reading configuration fails
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Apr 2021 16:45:39 +0000 (16:45 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Apr 2021 16:45:39 +0000 (16:45 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index 8c3f10b7da2a68cdc10374ce9fad02198a65ce69..8109cb8333a7f35b29bd8e5919fb8b8a935b7637 100644 (file)
@@ -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);