unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob fed7782171d399702d79e3bb5c415c99bbdbf5da 1979 bytes (raw)
name: gnu/packages/patches/geoclue-config.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 
From 45e310482350cfab628f359f2b0efebf06fb7c77 Mon Sep 17 00:00:00 2001
From: Sergey Trofimov <sarg@sarg.org.ru>
Date: Sat, 23 Nov 2024 14:12:21 +0100
Subject: [PATCH] Allow the configuration file to be specified via an
 environment variable.

---
 src/gclue-config.c        | 13 ++++++++++---
 src/gclue-static-source.c |  2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/gclue-config.c b/src/gclue-config.c
index acd6009..3045571 100644
--- a/src/gclue-config.c
+++ b/src/gclue-config.c
@@ -26,8 +26,8 @@
 
 #include "gclue-config.h"
 
-#define CONFIG_FILE_PATH SYSCONFDIR "/geoclue/geoclue.conf"
-#define CONFIG_D_DIRECTORY SYSCONFDIR "/geoclue/conf.d/"
+#define CONFIG_FILE_PATH "/etc/geoclue/geoclue.conf"
+#define CONFIG_D_DIRECTORY "/etc/geoclue/conf.d/"
 
 /* This class will be responsible for fetching configuration. */
 
@@ -546,8 +546,15 @@ gclue_config_init (GClueConfig *config)
         priv->wifi_submit_url = g_strdup (DEFAULT_WIFI_SUBMIT_URL);
         priv->wifi_submit_nick = g_strdup (DEFAULT_WIFI_SUBMIT_NICK);
 
-        /* Load config file from default path, log all missing parameters */
         priv->key_file = g_key_file_new ();
+
+        char *env_config_file = g_getenv ("GEOCLUE_CONFIG_FILE");
+        if (env_config_file) {
+                load_config_file (config, env_config_file);
+                goto out; // don't load conf.d
+        }
+
+        /* Load config file from default path, log all missing parameters */
         load_config_file (config, CONFIG_FILE_PATH);
 
         /*
diff --git a/src/gclue-static-source.c b/src/gclue-static-source.c
index 1c35cea..7957797 100644
--- a/src/gclue-static-source.c
+++ b/src/gclue-static-source.c
@@ -26,7 +26,7 @@
 #include "gclue-enum-types.h"
 
 #define GEO_FILE_NAME "geolocation"
-#define GEO_FILE_PATH SYSCONFDIR "/" GEO_FILE_NAME
+#define GEO_FILE_PATH "/etc/" GEO_FILE_NAME
 
 /* Rate limit of geolocation file monitoring.
  * In milliseconds.
-- 
2.46.0


debug log:

solving fed7782171 ...
found fed7782171 in https://yhetil.org/guix-patches/4a5f38bd6fd9c4c4a9610067e84675b11120be21.1732370909.git.sarg@sarg.org.ru/
found e4ef6f2d33 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 e4ef6f2d3318e3718f42009630950c2dc9faeb94	gnu/packages/patches/geoclue-config.patch

applying [1/1] https://yhetil.org/guix-patches/4a5f38bd6fd9c4c4a9610067e84675b11120be21.1732370909.git.sarg@sarg.org.ru/
diff --git a/gnu/packages/patches/geoclue-config.patch b/gnu/packages/patches/geoclue-config.patch
index e4ef6f2d33..fed7782171 100644

1:29: trailing whitespace.
 
1:31: trailing whitespace.
 
1:36: trailing whitespace.
 
1:38: trailing whitespace.
 
1:42: trailing whitespace.
 
Checking patch gnu/packages/patches/geoclue-config.patch...
Applied patch gnu/packages/patches/geoclue-config.patch cleanly.
warning: squelched 5 whitespace errors
warning: 10 lines add whitespace errors.

index at:
100644 fed7782171d399702d79e3bb5c415c99bbdbf5da	gnu/packages/patches/geoclue-config.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).