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 /app | |
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 'app')
-rw-r--r-- | app/xdg-app-builtins-build-export.c | 8 |
1 files changed, 8 insertions, 0 deletions
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)) |