forked from Mirrors/flatpak-builder
Add --log-*-bus to flatpak-builder --run
This requires https://github.com/flatpak/flatpak/pull/1160 Closes: #63 Approved by: alexlarssontingping/wmclass
parent
0a2c7a0dea
commit
cf9d35de32
|
@ -76,6 +76,8 @@ static char *opt_install_deps_from;
|
||||||
static gboolean opt_install_deps_only;
|
static gboolean opt_install_deps_only;
|
||||||
static gboolean opt_user;
|
static gboolean opt_user;
|
||||||
static char *opt_installation;
|
static char *opt_installation;
|
||||||
|
static gboolean opt_log_session_bus;
|
||||||
|
static gboolean opt_log_system_bus;
|
||||||
|
|
||||||
static GOptionEntry entries[] = {
|
static GOptionEntry entries[] = {
|
||||||
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &opt_verbose, "Print debug information during command processing", NULL },
|
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &opt_verbose, "Print debug information during command processing", NULL },
|
||||||
|
@ -130,6 +132,8 @@ static GOptionEntry run_entries[] = {
|
||||||
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &opt_verbose, "Print debug information during command processing", NULL },
|
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &opt_verbose, "Print debug information during command processing", NULL },
|
||||||
{ "arch", 0, 0, G_OPTION_ARG_STRING, &opt_arch, "Architecture to build for (must be host compatible)", "ARCH" },
|
{ "arch", 0, 0, G_OPTION_ARG_STRING, &opt_arch, "Architecture to build for (must be host compatible)", "ARCH" },
|
||||||
{ "run", 0, 0, G_OPTION_ARG_NONE, &opt_run, "Run a command in the build directory", NULL },
|
{ "run", 0, 0, G_OPTION_ARG_NONE, &opt_run, "Run a command in the build directory", NULL },
|
||||||
|
{ "log-session-bus", 0, 0, G_OPTION_ARG_NONE, &opt_log_session_bus, N_("Log session bus calls"), NULL },
|
||||||
|
{ "log-system-bus", 0, 0, G_OPTION_ARG_NONE, &opt_log_system_bus, N_("Log system bus calls"), NULL },
|
||||||
{ "ccache", 0, 0, G_OPTION_ARG_NONE, &opt_ccache, "Use ccache", NULL },
|
{ "ccache", 0, 0, G_OPTION_ARG_NONE, &opt_ccache, "Use ccache", NULL },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
@ -555,7 +559,9 @@ main (int argc,
|
||||||
|
|
||||||
if (!builder_manifest_run (manifest, build_context, arg_context,
|
if (!builder_manifest_run (manifest, build_context, arg_context,
|
||||||
orig_argv + first_non_arg + 2,
|
orig_argv + first_non_arg + 2,
|
||||||
orig_argc - first_non_arg - 2, &error))
|
orig_argc - first_non_arg - 2,
|
||||||
|
opt_log_session_bus, opt_log_system_bus,
|
||||||
|
&error))
|
||||||
{
|
{
|
||||||
g_printerr ("Error running %s: %s\n", argv[3], error->message);
|
g_printerr ("Error running %s: %s\n", argv[3], error->message);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -3410,6 +3410,8 @@ builder_manifest_run (BuilderManifest *self,
|
||||||
FlatpakContext *arg_context,
|
FlatpakContext *arg_context,
|
||||||
char **argv,
|
char **argv,
|
||||||
int argc,
|
int argc,
|
||||||
|
gboolean log_session_bus,
|
||||||
|
gboolean log_system_bus,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
g_autoptr(GPtrArray) args = NULL;
|
g_autoptr(GPtrArray) args = NULL;
|
||||||
|
@ -3460,6 +3462,12 @@ builder_manifest_run (BuilderManifest *self,
|
||||||
/* Just add something so that we get the default rules (own our own id) */
|
/* Just add something so that we get the default rules (own our own id) */
|
||||||
g_ptr_array_add (args, g_strdup ("--talk-name=org.freedesktop.DBus"));
|
g_ptr_array_add (args, g_strdup ("--talk-name=org.freedesktop.DBus"));
|
||||||
|
|
||||||
|
if (log_session_bus)
|
||||||
|
g_ptr_array_add (args, g_strdup ("--log-session-bus"));
|
||||||
|
|
||||||
|
if (log_system_bus)
|
||||||
|
g_ptr_array_add (args, g_strdup ("--log-system-bus"));
|
||||||
|
|
||||||
/* Inherit all finish args except --filesystem and some that
|
/* Inherit all finish args except --filesystem and some that
|
||||||
* build doesn't understand so the command gets the same access
|
* build doesn't understand so the command gets the same access
|
||||||
* as the final app
|
* as the final app
|
||||||
|
|
|
@ -100,6 +100,8 @@ gboolean builder_manifest_run (BuilderManifest *self,
|
||||||
FlatpakContext *arg_context,
|
FlatpakContext *arg_context,
|
||||||
char **argv,
|
char **argv,
|
||||||
int argc,
|
int argc,
|
||||||
|
gboolean log_session_bus,
|
||||||
|
gboolean log_system_bus,
|
||||||
GError **error);
|
GError **error);
|
||||||
gboolean builder_manifest_show_deps (BuilderManifest *self,
|
gboolean builder_manifest_show_deps (BuilderManifest *self,
|
||||||
BuilderContext *context,
|
BuilderContext *context,
|
||||||
|
|
Loading…
Reference in New Issue