diff options
-rw-r--r-- | contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd | 3 | ||||
-rw-r--r-- | contrib/packages/alpine/gnunet/gnunet.xsession | 1 | ||||
-rw-r--r-- | debian/etc/X11/xinit/xinitrc.d/80-gnunet-user-services | 1 | ||||
-rw-r--r-- | debian/gnunet.postinst | 3 | ||||
-rw-r--r-- | doc/man/gnunet-config.1 | 6 | ||||
-rw-r--r-- | src/util/common_logging.c | 16 | ||||
-rw-r--r-- | src/util/gnunet-config.c | 11 |
7 files changed, 17 insertions, 24 deletions
diff --git a/contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd b/contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd index 3c5a22ee2..2a4dcc1c4 100644 --- a/contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd +++ b/contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd | |||
@@ -21,12 +21,10 @@ start() { | |||
21 | # Customize gnunet.conf | 21 | # Customize gnunet.conf |
22 | port=$((8000+$(id -u $user))) | 22 | port=$((8000+$(id -u $user))) |
23 | gnunet-config -c /home/$user/.config/gnunet.conf \ | 23 | gnunet-config -c /home/$user/.config/gnunet.conf \ |
24 | --rewrite \ | ||
25 | --section=gns-proxy \ | 24 | --section=gns-proxy \ |
26 | --option=IMMEDIATE_START \ | 25 | --option=IMMEDIATE_START \ |
27 | --value=YES | 26 | --value=YES |
28 | gnunet-config -c /home/$user/.config/gnunet.conf \ | 27 | gnunet-config -c /home/$user/.config/gnunet.conf \ |
29 | --rewrite \ | ||
30 | --section=gns-proxy \ | 28 | --section=gns-proxy \ |
31 | --option=OPTIONS \ | 29 | --option=OPTIONS \ |
32 | --value="-p $port" | 30 | --value="-p $port" |
@@ -79,7 +77,6 @@ stop() { | |||
79 | 77 | ||
80 | # Disable gns-proxy in config | 78 | # Disable gns-proxy in config |
81 | gnunet-config -c /home/$user/.config/gnunet.conf \ | 79 | gnunet-config -c /home/$user/.config/gnunet.conf \ |
82 | --rewrite \ | ||
83 | --section=gns-proxy \ | 80 | --section=gns-proxy \ |
84 | --option=IMMEDIATE_START \ | 81 | --option=IMMEDIATE_START \ |
85 | --value=NO | 82 | --value=NO |
diff --git a/contrib/packages/alpine/gnunet/gnunet.xsession b/contrib/packages/alpine/gnunet/gnunet.xsession index 944d47a27..dead5c783 100644 --- a/contrib/packages/alpine/gnunet/gnunet.xsession +++ b/contrib/packages/alpine/gnunet/gnunet.xsession | |||
@@ -10,7 +10,6 @@ if [ "$gnunet_proxy" ]; then | |||
10 | port=$((8000+$(id -u $user))) | 10 | port=$((8000+$(id -u $user))) |
11 | 11 | ||
12 | gnunet-config -c /home/$user/.config/gnunet.conf \ | 12 | gnunet-config -c /home/$user/.config/gnunet.conf \ |
13 | --rewrite \ | ||
14 | --section=gns-proxy \ | 13 | --section=gns-proxy \ |
15 | --option=OPTIONS \ | 14 | --option=OPTIONS \ |
16 | --value="-p $port" | 15 | --value="-p $port" |
diff --git a/debian/etc/X11/xinit/xinitrc.d/80-gnunet-user-services b/debian/etc/X11/xinit/xinitrc.d/80-gnunet-user-services index aff1dd78c..d780b0e8e 100644 --- a/debian/etc/X11/xinit/xinitrc.d/80-gnunet-user-services +++ b/debian/etc/X11/xinit/xinitrc.d/80-gnunet-user-services | |||
@@ -9,7 +9,6 @@ if [ "$gnunet_proxy" ]; then | |||
9 | port=$((8000+$(id -u "$user"))) | 9 | port=$((8000+$(id -u "$user"))) |
10 | 10 | ||
11 | gnunet-config -c "$HOME/.config/gnunet.conf" \ | 11 | gnunet-config -c "$HOME/.config/gnunet.conf" \ |
12 | --rewrite \ | ||
13 | --section=gns-proxy \ | 12 | --section=gns-proxy \ |
14 | --option=OPTIONS \ | 13 | --option=OPTIONS \ |
15 | --value="-p $port" | 14 | --value="-p $port" |
diff --git a/debian/gnunet.postinst b/debian/gnunet.postinst index 07e5202e8..b6317f5be 100644 --- a/debian/gnunet.postinst +++ b/debian/gnunet.postinst | |||
@@ -149,12 +149,10 @@ EOF | |||
149 | fi | 149 | fi |
150 | port=$((8000+$(id -u "${users[$i]}"))) | 150 | port=$((8000+$(id -u "${users[$i]}"))) |
151 | gnunet-config -c "${homedirs[$i]}/.config/gnunet.conf" \ | 151 | gnunet-config -c "${homedirs[$i]}/.config/gnunet.conf" \ |
152 | --rewrite \ | ||
153 | --section=gns-proxy \ | 152 | --section=gns-proxy \ |
154 | --option=IMMEDIATE_START \ | 153 | --option=IMMEDIATE_START \ |
155 | --value=YES | 154 | --value=YES |
156 | gnunet-config -c "${homedirs[$i]}/.config/gnunet.conf" \ | 155 | gnunet-config -c "${homedirs[$i]}/.config/gnunet.conf" \ |
157 | --rewrite \ | ||
158 | --section=gns-proxy \ | 156 | --section=gns-proxy \ |
159 | --option=OPTIONS \ | 157 | --option=OPTIONS \ |
160 | --value="-p $port" | 158 | --value="-p $port" |
@@ -180,7 +178,6 @@ if [ "$gnunet_proxy" ]; then | |||
180 | port=$((8000+$(id -u $user))) | 178 | port=$((8000+$(id -u $user))) |
181 | 179 | ||
182 | gnunet-config -c $HOME/.config/gnunet.conf \ | 180 | gnunet-config -c $HOME/.config/gnunet.conf \ |
183 | --rewrite \ | ||
184 | --section=gns-proxy \ | 181 | --section=gns-proxy \ |
185 | --option=OPTIONS \ | 182 | --option=OPTIONS \ |
186 | --value="-p $port" | 183 | --value="-p $port" |
diff --git a/doc/man/gnunet-config.1 b/doc/man/gnunet-config.1 index f6166cbca..89bc3d14b 100644 --- a/doc/man/gnunet-config.1 +++ b/doc/man/gnunet-config.1 | |||
@@ -39,7 +39,7 @@ | |||
39 | .Op Fl s Ar SECTION | Fl -section= Ns Ar SECTION | 39 | .Op Fl s Ar SECTION | Fl -section= Ns Ar SECTION |
40 | .Op Fl V Ar VALUE | Fl -value Ar VALUE | 40 | .Op Fl V Ar VALUE | Fl -value Ar VALUE |
41 | .Op Fl v | -version | 41 | .Op Fl v | -version |
42 | .Op Fl W | -rewrite | 42 | .Op Fl w | -rewrite |
43 | .Sh DESCRIPTION | 43 | .Sh DESCRIPTION |
44 | .Nm | 44 | .Nm |
45 | can be used to read or modify GNUnet configuration files. | 45 | can be used to read or modify GNUnet configuration files. |
@@ -69,8 +69,8 @@ Configuration value to store in the given section under the given option. | |||
69 | Must only be given together with -s and -o options. | 69 | Must only be given together with -s and -o options. |
70 | .It Fl v | -version | 70 | .It Fl v | -version |
71 | Print GNUnet version number. | 71 | Print GNUnet version number. |
72 | .It Fl W | -rewrite | 72 | .It Fl w | -rewrite |
73 | Consider differences to defaults only. | 73 | Write to file the full configuration, including default values, instead of just the differences. |
74 | .El | 74 | .El |
75 | .Sh SEE ALSO | 75 | .Sh SEE ALSO |
76 | The full documentation for gnunet is maintained as a Texinfo manual. | 76 | The full documentation for gnunet is maintained as a Texinfo manual. |
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index b30175543..48cc6fe3b 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -246,27 +246,27 @@ static int gnunet_force_log_present; | |||
246 | 246 | ||
247 | /** | 247 | /** |
248 | * Convert a textual description of a loglevel | 248 | * Convert a textual description of a loglevel |
249 | * to the respective GNUNET_GE_KIND. | 249 | * to the respective enumeration type. |
250 | * | 250 | * |
251 | * @param log loglevel to parse | 251 | * @param log loglevel to parse |
252 | * @return GNUNET_GE_INVALID if log does not parse | 252 | * @return GNUNET_ERROR_TYPE_INVALID if log does not parse |
253 | */ | 253 | */ |
254 | static enum GNUNET_ErrorType | 254 | static enum GNUNET_ErrorType |
255 | get_type (const char *log) | 255 | get_type (const char *log) |
256 | { | 256 | { |
257 | if (NULL == log) | 257 | if (NULL == log) |
258 | return GNUNET_ERROR_TYPE_UNSPECIFIED; | 258 | return GNUNET_ERROR_TYPE_UNSPECIFIED; |
259 | if (0 == strcasecmp (log, _ ("DEBUG"))) | 259 | if (0 == strcasecmp (log, "DEBUG")) |
260 | return GNUNET_ERROR_TYPE_DEBUG; | 260 | return GNUNET_ERROR_TYPE_DEBUG; |
261 | if (0 == strcasecmp (log, _ ("INFO"))) | 261 | if (0 == strcasecmp (log, "INFO")) |
262 | return GNUNET_ERROR_TYPE_INFO; | 262 | return GNUNET_ERROR_TYPE_INFO; |
263 | if (0 == strcasecmp (log, _ ("MESSAGE"))) | 263 | if (0 == strcasecmp (log, "MESSAGE")) |
264 | return GNUNET_ERROR_TYPE_MESSAGE; | 264 | return GNUNET_ERROR_TYPE_MESSAGE; |
265 | if (0 == strcasecmp (log, _ ("WARNING"))) | 265 | if (0 == strcasecmp (log, "WARNING")) |
266 | return GNUNET_ERROR_TYPE_WARNING; | 266 | return GNUNET_ERROR_TYPE_WARNING; |
267 | if (0 == strcasecmp (log, _ ("ERROR"))) | 267 | if (0 == strcasecmp (log, "ERROR")) |
268 | return GNUNET_ERROR_TYPE_ERROR; | 268 | return GNUNET_ERROR_TYPE_ERROR; |
269 | if (0 == strcasecmp (log, _ ("NONE"))) | 269 | if (0 == strcasecmp (log, "NONE")) |
270 | return GNUNET_ERROR_TYPE_NONE; | 270 | return GNUNET_ERROR_TYPE_NONE; |
271 | return GNUNET_ERROR_TYPE_INVALID; | 271 | return GNUNET_ERROR_TYPE_INVALID; |
272 | } | 272 | } |
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c index 2b279dda2..4d050cdd3 100644 --- a/src/util/gnunet-config.c +++ b/src/util/gnunet-config.c | |||
@@ -65,10 +65,11 @@ static int list_sections; | |||
65 | static int global_ret; | 65 | static int global_ret; |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * Should we generate a configuration file that is clean and | 68 | * Should the generated configuration file contain the whole configuration, or |
69 | * only contains the deltas to the defaults? | 69 | * just the differences with the defaults? |
70 | * If set to a non-zero value, the full configuration will be written to file. | ||
70 | */ | 71 | */ |
71 | static int rewrite; | 72 | static int rewrite = 0; |
72 | 73 | ||
73 | 74 | ||
74 | /** | 75 | /** |
@@ -157,7 +158,7 @@ run (void *cls, | |||
157 | GNUNET_free (name); | 158 | GNUNET_free (name); |
158 | return; | 159 | return; |
159 | } | 160 | } |
160 | if (rewrite) | 161 | if (!rewrite) |
161 | { | 162 | { |
162 | struct GNUNET_CONFIGURATION_Handle *def; | 163 | struct GNUNET_CONFIGURATION_Handle *def; |
163 | 164 | ||
@@ -315,7 +316,7 @@ main (int argc, char *const *argv) | |||
315 | 'w', | 316 | 'w', |
316 | "rewrite", | 317 | "rewrite", |
317 | gettext_noop ( | 318 | gettext_noop ( |
318 | "write configuration file that only contains delta to defaults"), | 319 | "write the full configuration file, including default values"), |
319 | &rewrite), | 320 | &rewrite), |
320 | GNUNET_GETOPT_OPTION_END }; | 321 | GNUNET_GETOPT_OPTION_END }; |
321 | int ret; | 322 | int ret; |