-
-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect core.add-remotes-config-dir configuration option when adding remotes #1665
Comments
Another option is to finish off ostreedev/ostree#1166 so that flatpak can do sane remote modification instead of doing the "add remote with just URL if it doesn't exist then set options via |
See the comment added in the code for an explanation: if core.add-remotes-config-dir=true, we must avoid adding configuration in both /etc/flatpak/remotes.d/ and /ostree/repo/config. In lieu of actually supporting adding the configuration in the right place, bail early to avoid leaving partial configuration in the wrong place. Signed-off-by: Philip Withnall <withnall@endlessm.com> flatpak/flatpak#1665
See the comment added in the code for an explanation: if core.add-remotes-config-dir=true, we must avoid adding configuration in both /etc/flatpak/remotes.d/ and /ostree/repo/config. In lieu of actually supporting adding the configuration in the right place, bail early to avoid leaving partial configuration in the wrong place. Signed-off-by: Philip Withnall <withnall@endlessm.com> #1665
That would be the best option. I don’t have time to work on that at the moment though. :-( |
See the comment added in the code for an explanation: if core.add-remotes-config-dir=true, we must avoid adding configuration in both /etc/flatpak/remotes.d/ and /ostree/repo/config. In lieu of actually supporting adding the configuration in the right place, bail early to avoid leaving partial configuration in the wrong place. Signed-off-by: Philip Withnall <withnall@endlessm.com> #1665 Closes: #1666 Approved by: alexlarsson
See the comment added in the code for an explanation: if core.add-remotes-config-dir=true, we must avoid adding configuration in both /etc/flatpak/remotes.d/ and /ostree/repo/config. In lieu of actually supporting adding the configuration in the right place, bail early to avoid leaving partial configuration in the wrong place. Signed-off-by: Philip Withnall <withnall@endlessm.com> flatpak/flatpak#1665 Closes: #1666 Approved by: alexlarsson (cherry picked from commit d87d5ed)
@pwithnall this can be closed, right? |
Nope, the right fix is to modify the file which contains the particular remote config, rather than unconditionally modifying The long-term fix here is probably ostreedev/ostree#1166, but I’ll leave it for Alex to decide whether to defer to 1166, or whether to fix this in flatpak in the interim. |
There are currently a couple of places in
common/flatpak-dir.c
whereostree_repo_write_config()
is called to add per-remote configuration to the OSTree configuration. This won’t work if the repository is configured withcore.add-remotes-config-dir=true
. For the moment, OSTree setscore.add-remotes-config-dir=false
by default for non-system repositories (such as flatpak repositories). However, on systems where the OSTree and flatpak repositories are shared (such as Endless OS), this can cause problems ifcore.add-remotes-config-dir=false
isn’t explicitly configured. Problems likeflatpak remote-add
failing:The problem is that
ostree_repo_remote_[add|change]()
will preferentially write remote config to/etc/ostree/remotes.d/
(or wherever the configured remote-config-dir is), ifcore.add-remotes-config-dir=true
. Butostree_repo_write_config()
will always modify$repo_dir/config
.Since late last year, calls to
ostree_repo_write_config()
will error out ifcore.add-remotes-config-dir=true
is set, but the config provided to it contains remotes which are already defined in/etc/ostree/remotes.d
. This prevents the system getting into a bad state, but it does mean thatflatpak remote-add
is broken (it will not succeed, and will leave a partially-configured remote behind when it fails).Two functions in
common/flatpak-dir.c
are currently affected:flatpak_dir_modify_remote()
flatpak_dir_install_bundle()
For example, if I have:
Then I run:
I end up with:
The text was updated successfully, but these errors were encountered: