fu-util: Add a new --no-remote-check to ignore checking for download remotes

This fixes the overloaded `--no-metadata-check` that was previously
present from being used in multiple instances.
This commit is contained in:
Mario Limonciello 2020-12-14 11:49:28 -06:00 committed by Mario Limonciello
parent 89a2f190b6
commit a7d1530385
2 changed files with 8 additions and 2 deletions

View File

@ -50,6 +50,7 @@ _fwupdmgr_opts=(
'--no-metadata-check' '--no-metadata-check'
'--no-reboot-check' '--no-reboot-check'
'--no-safety-check' '--no-safety-check'
'--no-remote-check'
'--show-all' '--show-all'
'--sign' '--sign'
'--filter' '--filter'

View File

@ -61,6 +61,7 @@ struct FuUtilPrivate {
FwupdInstallFlags flags; FwupdInstallFlags flags;
FwupdClient *client; FwupdClient *client;
FuProgressbar *progressbar; FuProgressbar *progressbar;
gboolean no_remote_check;
gboolean no_metadata_check; gboolean no_metadata_check;
gboolean no_reboot_check; gboolean no_reboot_check;
gboolean no_unreported_check; gboolean no_unreported_check;
@ -1134,8 +1135,8 @@ fu_util_download_metadata (FuUtilPrivate *priv, GError **error)
/* no web remote is declared; try to enable LVFS */ /* no web remote is declared; try to enable LVFS */
if (!download_remote_enabled) { if (!download_remote_enabled) {
/* we don't want to ask anything */ /* we don't want to ask anything */
if (priv->no_metadata_check) { if (priv->no_remote_check) {
g_debug ("skipping metadata check"); g_debug ("skipping remote check");
return TRUE; return TRUE;
} }
@ -2740,6 +2741,9 @@ main (int argc, char *argv[])
{ "no-metadata-check", '\0', 0, G_OPTION_ARG_NONE, &priv->no_metadata_check, { "no-metadata-check", '\0', 0, G_OPTION_ARG_NONE, &priv->no_metadata_check,
/* TRANSLATORS: command line option */ /* TRANSLATORS: command line option */
_("Do not check for old metadata"), NULL }, _("Do not check for old metadata"), NULL },
{ "no-remote-check", '\0', 0, G_OPTION_ARG_NONE, &priv->no_remote_check,
/* TRANSLATORS: command line option */
_("Do not check if download remotes should be enabled"), NULL },
{ "no-reboot-check", '\0', 0, G_OPTION_ARG_NONE, &priv->no_reboot_check, { "no-reboot-check", '\0', 0, G_OPTION_ARG_NONE, &priv->no_reboot_check,
/* TRANSLATORS: command line option */ /* TRANSLATORS: command line option */
_("Do not check for reboot after update"), NULL }, _("Do not check for reboot after update"), NULL },
@ -3048,6 +3052,7 @@ main (int argc, char *argv[])
priv->no_metadata_check = TRUE; priv->no_metadata_check = TRUE;
priv->no_reboot_check = TRUE; priv->no_reboot_check = TRUE;
priv->no_safety_check = TRUE; priv->no_safety_check = TRUE;
priv->no_remote_check = TRUE;
fu_progressbar_set_interactive (priv->progressbar, FALSE); fu_progressbar_set_interactive (priv->progressbar, FALSE);
} }