GNOME Bugzilla – Bug 729343
ostree.repos.d
Last modified: 2014-05-09 12:43:22 UTC
The benefit is that upstream can ship a package that drops config into this directly. It would give them a clean way to upgrade that repo configuration later - for example, say they want to do stricter SSL checks.
Also, we should potentially support dynamic variable substitutions in the configuration. Use case: yum-like repos with $basearch $releasever.
Created attachment 276162 [details] [review] Support /etc/ostree/remotes.d For many OS install scenarios, one runs through an installer which may come with embedded data, and then the OS is configured post-install to receive updates. In this model, it'd be nice to avoid the post-install having to rewrite the /ostree/repo/config file. Additionally, it feels weird for admins to interact with "/ostree" - let's make the system feel more like Unix and have our important configuration in /etc.
Review of attachment 276162 [details] [review]: ::: src/libostree/ostree-repo.c @@ +511,3 @@ + char **subiter; + gs_strfreev char **keys = NULL; + Watch that whitespace! @@ +522,3 @@ + goto out; + } + Nice whitespace. @@ +538,3 @@ + return ret; +} + This space is white. @@ +553,3 @@ + cancellable, error)) + goto out; + while (direnum) /* Avoids extra if conditional */ Hm? @@ +573,3 @@ + { + if (!append_one_remote_config (self, path, cancellable, error)) + goto out; This seems wrong to me. The way I'm reading this, if I have a remote set up in .conf and also added one with "ostree remote blah", this will abort. I think the explicit one in the config should just overwrite the implicit one in the remotes.d, rather than bailing out.
(In reply to comment #3) > Hm? Otherwise I'd need to do: if (direnum) { while (TRUE) { ... } } > > @@ +573,3 @@ > + { > + if (!append_one_remote_config (self, path, cancellable, error)) > + goto out; > > This seems wrong to me. The way I'm reading this, if I have a remote set up in > .conf and also added one with "ostree remote blah", this will abort. I think > the explicit one in the config should just overwrite the implicit one in the > remotes.d, rather than bailing out. Well...you have a point here, but I'd say that remote add should likely write a .conf file.
(In reply to comment #4) > Otherwise I'd need to do: > > if (direnum) { > while (TRUE) { > ... > } > } I think that's clearer. while (direnum) implies that direnum can become NULL at some point. > Well...you have a point here, but I'd say that remote add should likely write a > .conf file. So we treat ostree/repo/config as legacy read-only remote configuration, rather than explicit config? OK.
Created attachment 276205 [details] [review] Support /etc/ostree/remotes.d "ostree remote add" now writes to /etc/ostree/remotes.d if the repository is the system repository.
Created attachment 276206 [details] [review] Support /etc/ostree/remotes.d Add extra if () clause
Review of attachment 276206 [details] [review]: lgtm
Attachment 276206 [details] pushed as f47a20f - Support /etc/ostree/remotes.d