build-import-bundle: Update repo similarly to build-export

This makes sure we update the summary, as well as take args for
gpg keys and whether to update the appstream branch.
This commit is contained in:
Alexander Larsson
2016-08-23 14:57:08 +02:00
parent 522ac5200b
commit 6386ea3222
2 changed files with 43 additions and 1 deletions

View File

@@ -34,10 +34,16 @@
static char *opt_ref;
static gboolean opt_oci = FALSE;
static char **opt_gpg_key_ids;
static char *opt_gpg_homedir;
static gboolean opt_update_appstream;
static GOptionEntry options[] = {
{ "ref", 0, 0, G_OPTION_ARG_STRING, &opt_ref, N_("Override the ref used for the imported bundle"), N_("REF") },
{ "oci", 0, 0, G_OPTION_ARG_NONE, &opt_oci, N_("Import oci image instead of flatpak bundle"), NULL },
{ "gpg-sign", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_gpg_key_ids, N_("GPG Key ID to sign the commit with"), N_("KEY-ID") },
{ "gpg-homedir", 0, 0, G_OPTION_ARG_STRING, &opt_gpg_homedir, N_("GPG Homedir to use when looking for keyrings"), N_("HOMEDIR") },
{ "update-appstream", 0, 0, G_OPTION_ARG_NONE, &opt_update_appstream, N_("Update the appstream branch"), NULL },
{ NULL }
};
@@ -303,7 +309,7 @@ flatpak_builtin_build_import (int argc, char **argv, GCancellable *cancellable,
if (!ostree_repo_open (repo, cancellable, error))
return FALSE;
if (opt_oci)
if (opt_oci)
{
if (!import_oci (repo, file, cancellable, error))
return FALSE;
@@ -314,6 +320,17 @@ if (opt_oci)
return FALSE;
}
if (opt_update_appstream &&
!flatpak_repo_generate_appstream (repo, (const char **) opt_gpg_key_ids, opt_gpg_homedir, cancellable, error))
return FALSE;
if (!flatpak_repo_update (repo,
(const char **) opt_gpg_key_ids,
opt_gpg_homedir,
cancellable,
error))
return FALSE;
return TRUE;
}

View File

@@ -89,6 +89,31 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--update-appstream</option></term>
<listitem><para>
Run appstream-builder and to update the appstream branch after build.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--gpg-sign=KEYID</option></term>
<listitem><para>
Sign the commit with this GPG key.
This option can be used multiple times.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--gpg-homedir=PATH</option></term>
<listitem><para>
GPG Homedir to use when looking for keyrings
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--version</option></term>