Fixup error messages

We were printing argv[3] which is wrong (and typically null).
Instead set the error message where it happens and we know
what we were trying to do.

Closes: #269
Approved by: alexlarsson
auto
Alexander Larsson 2019-02-06 10:01:14 +01:00 committed by Atomic Bot
parent 416b7f599b
commit 8839ff08b1
2 changed files with 7 additions and 3 deletions

View File

@ -724,7 +724,7 @@ main (int argc,
{
if (!builder_manifest_show_deps (manifest, build_context, &error))
{
g_printerr ("Error running %s: %s\n", argv[3], error->message);
g_printerr ("Error calculating deps: %s\n", error->message);
return 1;
}
@ -736,7 +736,7 @@ main (int argc,
if (!builder_manifest_install_deps (manifest, build_context, opt_install_deps_from, opt_user, opt_installation,
opt_yes, &error))
{
g_printerr ("Error running %s: %s\n", argv[3], error->message);
g_printerr ("Error installing deps: %s\n", error->message);
return 1;
}
if (opt_install_deps_only)

View File

@ -3701,7 +3701,11 @@ builder_manifest_install_dep (BuilderManifest *self,
g_ptr_array_add (args, NULL);
if (!builder_maybe_host_spawnv (NULL, NULL, 0, error, (const char * const *)args->pdata))
return FALSE;
{
g_autofree char *commandline = flatpak_quote_argv ((const char **)args->pdata);
g_prefix_error (error, "running `%s`: ", commandline);
return FALSE;
}
return TRUE;
}