Skip to content

Commit 6902972

Browse files
ColinKinlochbbhtt
andcommitted
builder-main: Install debug extension by default
Co-authored-by: bbhtt <[email protected]>
1 parent 71f2096 commit 6902972

File tree

1 file changed

+33
-15
lines changed

1 file changed

+33
-15
lines changed

src/builder-main.c

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ commit_screenshot_ref (const char *repo_path,
345345
static gboolean
346346
do_install (BuilderContext *build_context,
347347
const gchar *repodir,
348-
const gchar *id,
348+
GPtrArray *manifest_ids,
349349
const gchar *branch,
350350
GError **error)
351351
{
@@ -369,11 +369,15 @@ do_install (BuilderContext *build_context,
369369
g_ptr_array_add (args, g_strdup ("--noninteractive"));
370370
g_ptr_array_add (args, g_strdup ("--reinstall"));
371371

372-
ref = flatpak_build_untyped_ref (id, branch,
373-
builder_context_get_arch (build_context));
374-
375372
g_ptr_array_add (args, g_strdup (repodir));
376-
g_ptr_array_add (args, g_strdup (ref));
373+
374+
for (size_t i = 0; i < manifest_ids->len; i++)
375+
{
376+
const gchar *id = g_ptr_array_index (manifest_ids, i);
377+
ref = flatpak_build_untyped_ref (id, branch,
378+
builder_context_get_arch (build_context));
379+
g_ptr_array_add (args, g_strdup (ref));
380+
}
377381

378382
g_ptr_array_add (args, NULL);
379383

@@ -477,6 +481,7 @@ main (int argc,
477481
gboolean is_show_manifest = FALSE;
478482
gboolean app_dir_is_empty = FALSE;
479483
gboolean prune_unused_stages = FALSE;
484+
gboolean debug_exported = FALSE;
480485
g_autoptr(FlatpakContext) arg_context = NULL;
481486
g_autoptr(FlatpakTempDir) cleanup_manifest_dir = NULL;
482487
g_autofree char *manifest_basename = NULL;
@@ -1152,6 +1157,7 @@ main (int argc,
11521157
g_printerr ("Export failed: %s\n", error->message);
11531158
return 1;
11541159
}
1160+
debug_exported = TRUE;
11551161
}
11561162

11571163
for (l = builder_manifest_get_add_extensions (manifest); l != NULL; l = l->next)
@@ -1275,23 +1281,35 @@ main (int argc,
12751281
g_printerr ("NOTE: No export due to --require-changes, ignoring --install\n");
12761282
else
12771283
{
1284+
g_autoptr(GPtrArray) manifest_ids = g_ptr_array_new_with_free_func (g_free);
1285+
g_ptr_array_add (manifest_ids, g_strdup (builder_manifest_get_id (manifest)));
1286+
1287+
if (debug_exported)
1288+
g_ptr_array_add (manifest_ids, builder_manifest_get_debug_id (manifest));
1289+
12781290
if (!do_install (build_context, flatpak_file_get_path_cached (export_repo),
1279-
builder_manifest_get_id (manifest),
1291+
manifest_ids,
12801292
builder_manifest_get_branch (manifest, build_context),
12811293
&error))
12821294
{
12831295
g_printerr ("Install failed: %s\n", error->message);
12841296
return 1;
12851297
}
1286-
if (builder_manifest_get_id_platform (manifest) &&
1287-
(!do_install (build_context, flatpak_file_get_path_cached (export_repo),
1288-
builder_manifest_get_id_platform (manifest),
1289-
builder_manifest_get_branch (manifest, build_context),
1290-
&error)))
1291-
{
1292-
g_printerr ("Install failed: %s\n", error->message);
1293-
return 1;
1294-
}
1298+
1299+
if (builder_manifest_get_id_platform (manifest))
1300+
{
1301+
g_autoptr(GPtrArray) platform_ids = g_ptr_array_new_with_free_func (g_free);
1302+
g_ptr_array_add (platform_ids, g_strdup (builder_manifest_get_id_platform (manifest)));
1303+
1304+
if (!do_install (build_context, flatpak_file_get_path_cached (export_repo),
1305+
platform_ids,
1306+
builder_manifest_get_branch (manifest, build_context),
1307+
&error))
1308+
{
1309+
g_printerr ("Install failed: %s\n", error->message);
1310+
return 1;
1311+
}
1312+
}
12951313
}
12961314
}
12971315

0 commit comments

Comments
 (0)