]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Initialize some basic stuff earlier
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jun 2021 10:57:18 +0000 (10:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jun 2021 10:57:18 +0000 (10:57 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index 561084363cb110d57ac8348c36a8a164cad60b10..6a842388ed71d4c21d620532e47210b9906ae3ae 100644 (file)
@@ -814,6 +814,16 @@ PAKFIRE_EXPORT int pakfire_create(Pakfire* pakfire, const char* path, const char
        p->nrefs = 1;
        p->flags = flags;
 
+       // Set architecture
+       pakfire_string_set(p->arch, arch);
+
+       // Setup logging
+       p->log_function = pakfire_log_syslog;
+
+       const char* env = secure_getenv("PAKFIRE_LOG");
+       if (env)
+               pakfire_log_set_priority(p, log_priority(env));
+
        // Initialise configuration
        r = pakfire_config_create(&p->config);
        if (r)
@@ -835,16 +845,6 @@ PAKFIRE_EXPORT int pakfire_create(Pakfire* pakfire, const char* path, const char
        // Set path
        pakfire_string_set(p->path, path);
 
-       // Set architecture
-       pakfire_string_set(p->arch, arch);
-
-       // Setup logging
-       p->log_function = pakfire_log_syslog;
-
-       const char* env = secure_getenv("PAKFIRE_LOG");
-       if (env)
-               pakfire_log_set_priority(p, log_priority(env));
-
        // Read /etc/os-release
        r = pakfire_read_os_release(p);
        if (r && errno != ENOENT)