From 51e387159b0ff551f44fc58e962df4fa3aefce6e Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Sat, 30 Apr 2016 22:43:39 +0100 Subject: 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 --- app/xdg-app-builtins-build-export.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app') diff --git a/app/xdg-app-builtins-build-export.c b/app/xdg-app-builtins-build-export.c index 345f93b..d4b26e9 100644 --- a/app/xdg-app-builtins-build-export.c +++ b/app/xdg-app-builtins-build-export.c @@ -33,6 +33,7 @@ static char *opt_subject; static char *opt_body; +static char *opt_arch; static gboolean opt_runtime; static gboolean opt_update_appstream; static char **opt_gpg_key_ids; @@ -45,6 +46,7 @@ static char *opt_metadata; static GOptionEntry options[] = { { "subject", 's', 0, G_OPTION_ARG_STRING, &opt_subject, "One line subject", "SUBJECT" }, { "body", 'b', 0, G_OPTION_ARG_STRING, &opt_body, "Full description", "BODY" }, + { "arch", 0, 0, G_OPTION_ARG_STRING, &opt_arch, "Architecture to export for (must be host compatible)", "ARCH" }, { "runtime", 'r', 0, G_OPTION_ARG_NONE, &opt_runtime, "Commit runtime (/usr), not /app" }, { "update-appstream", 0, 0, G_OPTION_ARG_NONE, &opt_runtime, "Update the appstream branch" }, { "files", 0, 0, G_OPTION_ARG_STRING, &opt_files, "Use alternative directory for the files", "SUBDIR"}, @@ -65,6 +67,12 @@ metadata_get_arch (GFile *file, char **out_arch, GError **error) g_autofree char *runtime = NULL; g_auto(GStrv) parts = NULL; + if (opt_arch != NULL) + { + *out_arch = g_strdup (opt_arch); + return TRUE; + } + keyfile = g_key_file_new (); path = g_file_get_path (file); if (!g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, error)) -- cgit v1.2.1