diff options
author | Alexander Larsson <alexl@redhat.com> | 2015-12-03 13:29:08 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2015-12-03 13:29:08 +0100 |
commit | e76da99cdc25d918618d991bdbf5c1c458212d4f (patch) | |
tree | da2cbcbe1007cac721f10a7938111cca0978e08d /builder/builder-source-patch.c | |
parent | 9396419b6658830ff484c5d7a7f09f5700e7970f (diff) | |
download | xdg-app-e76da99cdc25d918618d991bdbf5c1c458212d4f.tar.gz |
builder: Merge spawn helpers to single base helper
Diffstat (limited to 'builder/builder-source-patch.c')
-rw-r--r-- | builder/builder-source-patch.c | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/builder/builder-source-patch.c b/builder/builder-source-patch.c index 6832acd..c701518 100644 --- a/builder/builder-source-patch.c +++ b/builder/builder-source-patch.c @@ -147,40 +147,16 @@ builder_source_patch_download (BuilderSource *source, static gboolean patch (GFile *dir, GError **error, - const gchar *argv1, ...) { - g_autoptr(GSubprocessLauncher) launcher = NULL; - g_autoptr(GSubprocess) subp = NULL; - GPtrArray *args; - const gchar *arg; + gboolean res; va_list ap; - args = g_ptr_array_new (); - g_ptr_array_add (args, "patch"); - va_start (ap, argv1); - g_ptr_array_add (args, (gchar *) argv1); - while ((arg = va_arg (ap, const gchar *))) - g_ptr_array_add (args, (gchar *) arg); - g_ptr_array_add (args, NULL); + va_start (ap, error); + res = xdg_app_spawn (dir, NULL, error, "git", ap); va_end (ap); - launcher = g_subprocess_launcher_new (0); - - if (dir) - { - g_autofree char *path = g_file_get_path (dir); - g_subprocess_launcher_set_cwd (launcher, path); - } - - subp = g_subprocess_launcher_spawnv (launcher, (const gchar * const *) args->pdata, error); - g_ptr_array_free (args, TRUE); - - if (subp == NULL || - !g_subprocess_wait_check (subp, NULL, error)) - return FALSE; - - return TRUE; + return res; } static gboolean |