lib: Add ostree_repo_reload_config()

For a long time we've cached the remote configs in the repo, which
mostly makes sense for the `repo/config` file, but less sense
for `/etc/ostree/remotes.d`, because we want to support admins
interactively editing them.

One can delete the repo instance and create a new one, but that's a bit ugly.
Let's introduce an API for this so rpm-ostree can reload remotes after
admins/scripts edit them in `/etc`.  We also might as well reload
any other entries in the config.

Structurually now, `ostree_repo_open()` deals with file descriptors, and then
calls `ostree_repo_reload_config()`. Except for the uncompressed cache, which is
the only thing that deals with FDs that can be configured. But we want to delete
that anyways.

No tests, since...we don't have a daemon in this codebase, don't want to shave
that yak just today.

Closes: #662
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-02-07 16:12:58 +00:00
1 parent 200887c7c9
commit 9c0af41710
4 files changed
+147 -105

No files matched your search

+5
View File
@@ -101,6 +101,11 @@ GKeyFile * ostree_repo_get_config (OstreeRepo *self);
_OSTREE_PUBLIC
GKeyFile * ostree_repo_copy_config (OstreeRepo *self);
_OSTREE_PUBLIC
gboolean ostree_repo_reload_config (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
_OSTREE_PUBLIC
gboolean ostree_repo_remote_add (OstreeRepo *self,
const char *name,