mirror of
https://github.com/flatpak/flatpak.git
synced 2026-02-18 14:49:36 -05:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user