[gnome-builder: 2/2] makecache: correctly modify subprocess args for 'make -C'
- From: Matthew Leeds <mwleeds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder: 2/2] makecache: correctly modify subprocess args for 'make -C'
- Date: Fri, 17 Feb 2017 22:28:00 +0000 (UTC)
commit 91b9b1da8c460546f76795a4bd885e678df05661
Author: Matthew Leeds <mleeds redhat com>
Date: Fri Feb 17 16:06:47 2017 -0600
makecache: correctly modify subprocess args for 'make -C'
The GbpFlatpakSubprocessLauncher modifies the command line arguments
just before spawning subprocesses, so the position of the subdirectory
(in "... make -C <subdirectory> ...") changes between the first and
second spawn from the same launcher. This causes the
ide_makecache_get_build_targets_worker to replace the wrong argument in
the list when switching to a different subdirectory. This commit fixes
the issue by looking for the "-C" argument each time before replacing
the argument and launching a process.
plugins/autotools/ide-makecache.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/plugins/autotools/ide-makecache.c b/plugins/autotools/ide-makecache.c
index 44774c5..6a9a4b3 100644
--- a/plugins/autotools/ide-makecache.c
+++ b/plugins/autotools/ide-makecache.c
@@ -1590,7 +1590,18 @@ ide_makecache_get_build_targets_worker (GTask *task,
}
else
{
- ide_subprocess_launcher_replace_argv (launcher, (num_args + 1), rel_path);
+ /*
+ * Because the launcher might modify the arguments (as the flatpak one does),
+ * we should recalculate where the subdirectory is in the list.
+ */
+ const gchar * const * current_argv;
+ guint subdir_pos;
+ current_argv = ide_subprocess_launcher_get_argv (launcher);
+ for (subdir_pos = 0;
+ current_argv[subdir_pos] != NULL &&
+ g_strcmp0 (current_argv[subdir_pos], "-C") != 0;
+ subdir_pos++) { }
+ ide_subprocess_launcher_replace_argv (launcher, (subdir_pos + 1), rel_path);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]