summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2014-06-06 16:17:05 -0400
committerColin Walters <walters@verbum.org>2014-06-19 04:39:28 -0400
commitbb043b319f0a399608c89ce32472468199083e6d (patch)
tree6f143ea339f4f61048bd524f6fa65d78db2be03c
parent3d5ff5b542b2bf8e417e48afcfde4ecb9f27866f (diff)
downloadostree-bb043b319f0a399608c89ce32472468199083e6d.tar.gz
pull: Emit a better error if the remote isn't found
The generic GKeyFile error isn't quite informative enough here. I hit this with the new compose process where we don't automatically inject a configured remote into the generated disk images; we expect people to add them. https://bugzilla.gnome.org/show_bug.cgi?id=731346
-rw-r--r--src/libostree/ostree-repo-pull.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index dbcdc405..d15e3369 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -1067,8 +1067,16 @@ ostree_repo_pull (OstreeRepo *self,
config = ostree_repo_get_config (self);
remote_key = g_strdup_printf ("remote \"%s\"", pull_data->remote_name);
+ if (!g_key_file_has_group (config, remote_key))
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "No remote '%s' found in " SYSCONFDIR "/ostree/remotes.d",
+ remote_key);
+ goto out;
+ }
if (!repo_get_string_key_inherit (self, remote_key, "url", &baseurl, error))
goto out;
+
pull_data->base_uri = soup_uri_new (baseurl);
#ifdef HAVE_GPGME