After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729343 - ostree.repos.d
ostree.repos.d
Status: RESOLVED FIXED
Product: ostree
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: OSTree maintainer(s)
OSTree maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-05-01 16:35 UTC by Colin Walters
Modified: 2014-05-09 12:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Support /etc/ostree/remotes.d (7.41 KB, patch)
2014-05-08 13:47 UTC, Colin Walters
reviewed Details | Review
Support /etc/ostree/remotes.d (15.46 KB, patch)
2014-05-08 22:58 UTC, Colin Walters
none Details | Review
Support /etc/ostree/remotes.d (15.54 KB, patch)
2014-05-08 22:59 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2014-05-01 16:35:07 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.
Comment 1 Colin Walters 2014-05-08 10:56:15 UTC
Also, we should potentially support dynamic variable substitutions in the configuration.

Use case: yum-like repos with $basearch $releasever.
Comment 2 Colin Walters 2014-05-08 13:47:45 UTC
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.
Comment 3 Jasper St. Pierre (not reading bugmail) 2014-05-08 14:08:02 UTC
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.
Comment 4 Colin Walters 2014-05-08 16:00:35 UTC
(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.
Comment 5 Jasper St. Pierre (not reading bugmail) 2014-05-08 16:06:04 UTC
(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.
Comment 6 Colin Walters 2014-05-08 22:58:41 UTC
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.
Comment 7 Colin Walters 2014-05-08 22:59:48 UTC
Created attachment 276206 [details] [review]
Support /etc/ostree/remotes.d

Add extra if () clause
Comment 8 Jasper St. Pierre (not reading bugmail) 2014-05-09 04:17:58 UTC
Review of attachment 276206 [details] [review]:

lgtm
Comment 9 Colin Walters 2014-05-09 12:43:19 UTC
Attachment 276206 [details] pushed as f47a20f - Support /etc/ostree/remotes.d