From 897fe1b76890842cb81204f70a31fa379bf1d83b Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 11 Jan 2018 02:41:17 -0800 Subject: [PATCH] utils: add GSubprocessFlags parameter This allows us to pass it through in the case we're running in the same pid namespace as the flatpak-builder process. Closes: #100 Approved by: alexlarsson --- src/builder-main.c | 1 + src/builder-manifest.c | 4 ++-- src/builder-module.c | 2 +- src/builder-source-shell.c | 2 +- src/builder-utils.c | 6 ++++-- src/builder-utils.h | 2 ++ 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/builder-main.c b/src/builder-main.c index 9125fcf4..73c4ee14 100644 --- a/src/builder-main.c +++ b/src/builder-main.c @@ -830,6 +830,7 @@ main (int argc, { if (!builder_maybe_host_spawnv (NULL, NULL, + 0, &error, argv)) { diff --git a/src/builder-manifest.c b/src/builder-manifest.c index d6c439c4..de19a749 100644 --- a/src/builder-manifest.c +++ b/src/builder-manifest.c @@ -1867,7 +1867,7 @@ command (GFile *app_dir, g_ptr_array_add (args, g_strdup (commandline)); g_ptr_array_add (args, NULL); - return builder_maybe_host_spawnv (NULL, NULL, error, (const char * const *)args->pdata); + return builder_maybe_host_spawnv (NULL, NULL, 0, error, (const char * const *)args->pdata); } typedef gboolean (*ForeachFileFunc) (BuilderManifest *self, @@ -2037,7 +2037,7 @@ appstream_compose (GFile *app_dir, g_ptr_array_add (args, NULL); va_end (ap); - if (!builder_maybe_host_spawnv (NULL, NULL, error, (const char * const *)args->pdata)) + if (!builder_maybe_host_spawnv (NULL, NULL, 0, error, (const char * const *)args->pdata)) { g_prefix_error (error, "ERROR: appstream-compose failed: "); return FALSE; diff --git a/src/builder-module.c b/src/builder-module.c index 08be4690..146ed797 100644 --- a/src/builder-module.c +++ b/src/builder-module.c @@ -1279,7 +1279,7 @@ build (GFile *app_dir, g_ptr_array_add (args, NULL); - if (!builder_maybe_host_spawnv (cwd_file, NULL, error, (const char * const *)args->pdata)) + if (!builder_maybe_host_spawnv (cwd_file, NULL, 0, error, (const char * const *)args->pdata)) { g_prefix_error (error, "module %s: ", module_name); return FALSE; diff --git a/src/builder-source-shell.c b/src/builder-source-shell.c index 5a92f53f..2a4a2b81 100644 --- a/src/builder-source-shell.c +++ b/src/builder-source-shell.c @@ -160,7 +160,7 @@ run_script (BuilderContext *context, source_dir_path_canonical_file = g_file_new_for_path (source_dir_path_canonical); - return builder_maybe_host_spawnv (source_dir_path_canonical_file, NULL, error, (const char * const *)args->pdata); + return builder_maybe_host_spawnv (source_dir_path_canonical_file, NULL, 0, error, (const char * const *)args->pdata); } diff --git a/src/builder-utils.c b/src/builder-utils.c index 68874de7..4e484aaa 100644 --- a/src/builder-utils.c +++ b/src/builder-utils.c @@ -1456,6 +1456,7 @@ sigint_handler (gpointer user_data) gboolean builder_host_spawnv (GFile *dir, char **output, + GSubprocessFlags flags, GError **error, const gchar * const *argv) { @@ -1611,13 +1612,14 @@ builder_host_spawnv (GFile *dir, gboolean builder_maybe_host_spawnv (GFile *dir, char **output, + GSubprocessFlags flags, GError **error, const gchar * const *argv) { if (flatpak_is_in_sandbox ()) - return builder_host_spawnv (dir, output, error, argv); + return builder_host_spawnv (dir, output, 0, error, argv); - return flatpak_spawnv (dir, output, 0, error, argv); + return flatpak_spawnv (dir, output, flags, error, argv); } /** diff --git a/src/builder-utils.h b/src/builder-utils.h index 7dfcfe71..e098d4c3 100644 --- a/src/builder-utils.h +++ b/src/builder-utils.h @@ -63,10 +63,12 @@ gboolean builder_migrate_locale_dirs (GFile *root_dir, gboolean builder_host_spawnv (GFile *dir, char **output, + GSubprocessFlags flags, GError **error, const gchar * const *argv); gboolean builder_maybe_host_spawnv (GFile *dir, char **output, + GSubprocessFlags flags, GError **error, const gchar * const *argv);