Skip to content

Commit

Permalink
Merge pull request #3136 from ericcurtin/pr-3134-feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jlebon authored Jan 9, 2024
2 parents b79a2e1 + 477d472 commit 062cf60
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions man/ostree-admin-status.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ License along with this library. If not, see <https://www.gnu.org/licenses/>.
</varlistentry>

<varlistentry>
<term><option>-Q, --query-booted</option></term>
<term><option>-D, --is-default</option></term>

<listitem><para>
Output the string <literal>default</literal> if the default deployment
Expand All @@ -111,7 +111,7 @@ License along with this library. If not, see <https://www.gnu.org/licenses/>.
</varlistentry>

<varlistentry>
<term><option>--version</option>--version</term>
<term><option>--version</option></term>

<listitem><para>
Print version information and exit
Expand Down
28 changes: 12 additions & 16 deletions src/ostree/ot-admin-builtin-status.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,17 @@

static gboolean opt_verify;
static gboolean opt_skip_signatures;
static gboolean opt_query_booted;

static GOptionEntry options[] = {
{ "verify", 'V', 0, G_OPTION_ARG_NONE, &opt_verify, "Print the commit verification status",
NULL },
{ "skip-signatures", 'S', 0, G_OPTION_ARG_NONE, &opt_skip_signatures, "Skip signatures in output",
NULL },
{ "query-booted", 'Q', 0, G_OPTION_ARG_NONE, &opt_query_booted,
"Output the string \"default\" if the default deployment is the booted one, \"not-default\" if "
"we are booted in a non-default deployment (e.g. the user interactively chose a different "
"entry in the bootloader menu, or the bootloader rolled back automatically, etc.). If we are "
"not in a booted OSTree system, an error is returned.",
NULL },
{ NULL }
};
static gboolean opt_is_default;

static GOptionEntry options[]
= { { "verify", 'V', 0, G_OPTION_ARG_NONE, &opt_verify, "Print the commit verification status",
NULL },
{ "skip-signatures", 'S', 0, G_OPTION_ARG_NONE, &opt_skip_signatures,
"Skip signatures in output", NULL },
{ "is-default", 'D', 0, G_OPTION_ARG_NONE, &opt_is_default,
"Output \"default\" if booted into the default deployment, otherwise \"not-default\"",
NULL },
{ NULL } };
static gboolean
deployment_print_status (OstreeSysroot *sysroot, OstreeRepo *repo, OstreeDeployment *deployment,
gboolean is_booted, gboolean is_pending, gboolean is_rollback,
Expand Down Expand Up @@ -210,7 +206,7 @@ ot_admin_builtin_status (int argc, char **argv, OstreeCommandInvocation *invocat
if (booted_deployment)
ostree_sysroot_query_deployments_for (sysroot, NULL, &pending_deployment, &rollback_deployment);

if (opt_query_booted)
if (opt_is_default)
{
if (deployments->len == 0)
return glnx_throw (error, "Not in a booted OSTree system");
Expand Down

0 comments on commit 062cf60

Please sign in to comment.