static gboolean do_export (BuilderContext *build_context, GError **error, gboolean runtime, ...) { va_list ap; const char *arg; int i; g_autoptr(GPtrArray) args = NULL; g_autoptr(GSubprocess) subp = NULL; args = g_ptr_array_new_with_free_func (g_free); g_ptr_array_add (args, g_strdup ("flatpak")); 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")); if (opt_subject) g_ptr_array_add (args, g_strdup_printf ("--subject=%s", opt_subject)); if (opt_body) g_ptr_array_add (args, g_strdup_printf ("--body=%s", opt_body)); if (opt_gpg_homedir) g_ptr_array_add (args, g_strdup_printf ("--gpg-homedir=%s", opt_gpg_homedir)); for (i = 0; opt_key_ids != NULL && opt_key_ids[i] != NULL; i++) g_ptr_array_add (args, g_strdup_printf ("--gpg-sign=%s", opt_key_ids[i])); va_start (ap, runtime); while ((arg = va_arg (ap, const gchar *))) if (arg != skip_arg) g_ptr_array_add (args, g_strdup ((gchar *) arg)); va_end (ap); g_ptr_array_add (args, NULL); subp = g_subprocess_newv ((const gchar * const *) args->pdata, G_SUBPROCESS_FLAGS_NONE, error); if (subp == NULL || !g_subprocess_wait_check (subp, NULL, error)) return FALSE; return TRUE; }
static GList * get_arched_options (BuilderOptions *self, BuilderContext *context) { GList *options = NULL; const char *arch = builder_context_get_arch (context); BuilderOptions *arch_options; arch_options = g_hash_table_lookup (self->arch, arch); if (arch_options) options = g_list_prepend (options, arch_options); options = g_list_prepend (options, self); return options; }
void builder_options_checksum (BuilderOptions *self, BuilderCache *cache, BuilderContext *context) { BuilderOptions *arch_options; builder_cache_checksum_str (cache, BUILDER_OPTION_CHECKSUM_VERSION); builder_cache_checksum_str (cache, self->cflags); builder_cache_checksum_str (cache, self->cxxflags); builder_cache_checksum_str (cache, self->prefix); builder_cache_checksum_strv (cache, self->env); builder_cache_checksum_strv (cache, self->build_args); builder_cache_checksum_boolean (cache, self->strip); builder_cache_checksum_boolean (cache, self->no_debuginfo); arch_options = g_hash_table_lookup (self->arch, builder_context_get_arch (context)); if (arch_options) builder_options_checksum (arch_options, cache, context); }