mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-30 07:42:23 +02:00
If a user created a custom config file and we added new fields in a newer version, `eg25-manager` will crash by assuming all config files are complete and up-to-date. Moreover, creating a custom config, even to change only one option, required copying a complete default config file and then editing the relevant field(s). This could lead to issues when upgrading, as default values of fields unrelated to the user change could be modified and not applied to the user config. This patch addresses both these issues by: * making sure at least one config file exists * requiring only the "default" config file (the one under `/usr/share`) to include all the required fields * trying to use user config for each field, falling back to the default config file if the field isn't present in the user config * exiting with a meaningful error message in case the default config file is missing a required field or section That way, it will be possible to have a minimal user config file containing only the field(s) needing a different value than the default one, falling back to the values in the default config file. Fixes #23
18 lines
400 B
C
18 lines
400 B
C
/*
|
|
* Copyright (C) 2021 Dylan Van Assche <me@dylanvanassche.be>
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <time.h>
|
|
#include <unistd.h>
|
|
#include <curl/curl.h>
|
|
|
|
#include "manager.h"
|
|
|
|
void gnss_init(struct EG25Manager *manager, toml_table_t *config[]);
|
|
void gnss_destroy(struct EG25Manager *manager);
|
|
gboolean gnss_upload_assistance_data(struct EG25Manager *manager);
|