builder: Avoid a confusing error

When the sdk is not specified in the manifest, we get a confusing
error from running flatpak info with an invalid commandline.
Avoid that by checking for the the sdk string beforehand.
tingping/wmclass
Matthias Clasen 2016-05-26 23:35:41 -04:00
parent 1d8408e381
commit c89a610a91
1 changed files with 7 additions and 0 deletions

View File

@ -844,6 +844,13 @@ builder_manifest_start (BuilderManifest *self,
{
g_autofree char *arch_option;
if (self->sdk == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"sdk not specified");
return FALSE;
}
arch_option = g_strdup_printf ("--arch=%s", builder_context_get_arch (context));
self->sdk_commit = flatpak (NULL, "info", arch_option, "--show-commit", self->sdk,