diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2016-04-30 22:43:39 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2016-05-03 09:05:56 +0200 |
commit | 51e387159b0ff551f44fc58e962df4fa3aefce6e (patch) | |
tree | 094f7b696e978be10cadeea47e45048901d2e4a6 /builder | |
parent | 4d21107f1cca8986b73c61bbffc4c7caa08cccaa (diff) | |
download | xdg-app-51e387159b0ff551f44fc58e962df4fa3aefce6e.tar.gz |
build-export: Add --arch option
This patch adds the --arch option to the build-export builtin command.
Previously build-export derives this from the metadata and then falls back
to xdg_app_get_arch(), except that this does not work when the metadata does
not specify an arch (such as with extensions like .Debug or .Locale).
https://bugs.freedesktop.org/show_bug.cgi?id=95226
Diffstat (limited to 'builder')
-rw-r--r-- | builder/xdg-app-builder-main.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/builder/xdg-app-builder-main.c b/builder/xdg-app-builder-main.c index 2107347..6057458 100644 --- a/builder/xdg-app-builder-main.c +++ b/builder/xdg-app-builder-main.c @@ -98,8 +98,9 @@ usage (GOptionContext *context, const char *message) static const char skip_arg[] = "skip"; static gboolean -do_export (GError **error, - gboolean runtime, +do_export (BuilderContext *build_context, + GError **error, + gboolean runtime, ...) { va_list ap; @@ -113,6 +114,8 @@ do_export (GError **error, g_ptr_array_add (args, g_strdup ("xdg-app")); g_ptr_array_add (args, g_strdup ("build-export")); + g_ptr_array_add (args, g_strdup_printf ("--arch=%s", builder_context_get_arch (build_context))); + if (runtime) g_ptr_array_add (args, g_strdup ("--runtime")); @@ -369,7 +372,7 @@ main (int argc, g_print ("exporting %s to repo\n", builder_manifest_get_id (manifest)); - if (!do_export (&error, + if (!do_export (build_context, &error, builder_context_get_build_runtime (build_context), "--exclude=/lib/debug/*", "--include=/lib/debug/app", @@ -402,7 +405,7 @@ main (int argc, metadata_arg = g_strdup_printf ("--metadata=%s", name); files_arg = g_strconcat (builder_context_get_build_runtime (build_context) ? "--files=usr" : "--files=files", "/share/runtime/locale/", NULL); - if (!do_export (&error, TRUE, + if (!do_export (build_context, &error, TRUE, metadata_arg, files_arg, opt_repo, app_dir_path, builder_manifest_get_branch (manifest), NULL)) @@ -418,7 +421,7 @@ main (int argc, { g_print ("exporting %s.Debug to repo\n", builder_manifest_get_id (manifest)); - if (!do_export (&error, TRUE, + if (!do_export (build_context, &error, TRUE, "--metadata=metadata.debuginfo", builder_context_get_build_runtime (build_context) ? "--files=usr/lib/debug" : "--files=files/lib/debug", opt_repo, app_dir_path, builder_manifest_get_branch (manifest), NULL)) @@ -435,7 +438,7 @@ main (int argc, { g_print ("exporting %s to repo\n", platform_id); - if (!do_export (&error, TRUE, + if (!do_export (build_context, &error, TRUE, "--metadata=metadata.platform", "--files=platform", builder_context_get_separate_locales (build_context) ? "--exclude=/share/runtime/locale/*/*" : skip_arg, @@ -467,7 +470,7 @@ main (int argc, metadata_arg = g_strdup_printf ("--metadata=%s", name); files_arg = g_strconcat ("--files=platform/share/runtime/locale/", NULL); - if (!do_export (&error, TRUE, + if (!do_export (build_context, &error, TRUE, metadata_arg, files_arg, opt_repo, app_dir_path, builder_manifest_get_branch (manifest), NULL)) |