diff options
author | Colin Walters <walters@verbum.org> | 2021-09-07 18:02:24 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2021-09-08 07:42:25 -0400 |
commit | 511c7a13eeae0161f16a11033eec36252c6390ae (patch) | |
tree | 28a996981826f87109b615fefa4fa0acfbb47434 /src/libostree/ostree-repo-pull.c | |
parent | 55a7e74fee369a22f9154b66136c7935fd3129f8 (diff) | |
download | ostree-511c7a13eeae0161f16a11033eec36252c6390ae.tar.gz |
Add support for "custom remotes"
This will be helpful for the "ostree native container" work in
https://github.com/ostreedev/ostree-rs-ext/
Basically in order to reuse GPG/signapi verification, we need
to support adding a remote, even though it can't be used via
`ostree pull`. (At least, not until we merge ostree-rs-ext into ostree, but
even then I think the principle stands)
Diffstat (limited to 'src/libostree/ostree-repo-pull.c')
-rw-r--r-- | src/libostree/ostree-repo-pull.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 12409e63..04a5359f 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -3965,6 +3965,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, else { g_autofree char *unconfigured_state = NULL; + g_autofree char *custom_backend = NULL; g_free (pull_data->remote_name); pull_data->remote_name = g_strdup (remote_name_or_baseurl); @@ -3996,6 +3997,20 @@ ostree_repo_pull_with_options (OstreeRepo *self, "remote unconfigured-state: %s", unconfigured_state); goto out; } + + if (!ostree_repo_get_remote_option (self, pull_data->remote_name, + "custom-backend", NULL, + &custom_backend, + error)) + goto out; + + if (custom_backend) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, + "Cannot fetch via libostree - remote '%s' uses custom backend '%s'", + pull_data->remote_name, custom_backend); + goto out; + } } if (pull_data->remote_name && !(disable_sign_verify && disable_sign_verify_summary)) |