summaryrefslogtreecommitdiff
path: root/client/as-builder.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-12-17 15:57:39 +0000
committerRichard Hughes <richard@hughsie.com>2014-12-17 15:57:41 +0000
commit85dfc0cb9676f49e42cd309b7256bcd222b7207f (patch)
treecf0ac816e08cf59b855d43b75e0bd169d0476297 /client/as-builder.c
parent28b62e53cc4b53b98081df505869c339a2936a3f (diff)
downloadappstream-glib-85dfc0cb9676f49e42cd309b7256bcd222b7207f.tar.gz
Add an --origin option to appstream-builder
By splitting up the origin and basename properties we can have files with a predictable basename and the correct origin. Now, most people will want to invoke appstream-builder with --origin=foo and leave --basename to the default of 'appstream'.
Diffstat (limited to 'client/as-builder.c')
-rw-r--r--client/as-builder.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/client/as-builder.c b/client/as-builder.c
index 7f22323..e981456 100644
--- a/client/as-builder.c
+++ b/client/as-builder.c
@@ -84,6 +84,7 @@ main (int argc, char **argv)
_cleanup_free_ gchar *extra_screenshots = NULL;
_cleanup_free_ gchar *log_dir = NULL;
_cleanup_free_ gchar *old_metadata = NULL;
+ _cleanup_free_ gchar *origin = NULL;
_cleanup_free_ gchar *output_dir = NULL;
_cleanup_free_ gchar *packages_dir = NULL;
_cleanup_free_ gchar *screenshot_dir = NULL;
@@ -137,6 +138,9 @@ main (int argc, char **argv)
_("Set the cache directory"), "DIR" },
{ "basename", '\0', 0, G_OPTION_ARG_STRING, &basename,
/* TRANSLATORS: command line option */
+ _("Set the basenames of the output files"), "NAME" },
+ { "origin", '\0', 0, G_OPTION_ARG_STRING, &origin,
+ /* TRANSLATORS: command line option */
_("Set the origin name"), "NAME" },
{ "max-threads", '\0', 0, G_OPTION_ARG_INT, &max_threads,
/* TRANSLATORS: command line option */
@@ -199,7 +203,9 @@ main (int argc, char **argv)
if (cache_dir == NULL)
cache_dir = g_strdup ("./cache");
if (basename == NULL)
- basename = g_strdup ("example");
+ basename = g_strdup ("appstream");
+ if (origin == NULL)
+ origin = g_strdup ("example");
if (screenshot_uri == NULL)
screenshot_uri = g_strdup ("http://www.example.com/screenshots/");
if (extra_appstream == NULL)
@@ -227,6 +233,7 @@ main (int argc, char **argv)
asb_context_set_output_dir (ctx, output_dir);
asb_context_set_cache_dir (ctx, cache_dir);
asb_context_set_basename (ctx, basename);
+ asb_context_set_origin (ctx, origin);
asb_context_set_max_threads (ctx, max_threads);
asb_context_set_min_icon_size (ctx, min_icon_size);
ret = asb_context_setup (ctx, &error);