summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2022-06-14 09:50:07 -0400
committerColin Walters <walters@verbum.org>2022-06-14 09:51:41 -0400
commit588b07e5542106eb3baef046f7858b9c6f56736f (patch)
tree89154ddc90b68cd6379a42bf419bae8ab0d798b8
parent46e1db392d59e6956d705037feaf6c64b8a15a16 (diff)
downloadostree-588b07e5542106eb3baef046f7858b9c6f56736f.tar.gz
cli/undeploy: Port to C99 style
General background cleanup.
-rw-r--r--src/ostree/ot-admin-builtin-undeploy.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/ostree/ot-admin-builtin-undeploy.c b/src/ostree/ot-admin-builtin-undeploy.c
index 41155689..c079c83f 100644
--- a/src/ostree/ot-admin-builtin-undeploy.c
+++ b/src/ostree/ot-admin-builtin-undeploy.c
@@ -34,15 +34,9 @@ static GOptionEntry options[] = {
gboolean
ot_admin_builtin_undeploy (int argc, char **argv, OstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error)
{
- g_autoptr(GOptionContext) context = NULL;
- g_autoptr(OstreeSysroot) sysroot = NULL;
- const char *deploy_index_str;
- int deploy_index;
- g_autoptr(GPtrArray) current_deployments = NULL;
- g_autoptr(OstreeDeployment) target_deployment = NULL;
-
- context = g_option_context_new ("INDEX");
+ g_autoptr(GOptionContext) context = g_option_context_new ("INDEX");
+ g_autoptr(OstreeSysroot) sysroot = NULL;
if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER,
invocation, &sysroot, cancellable, error))
@@ -54,12 +48,13 @@ ot_admin_builtin_undeploy (int argc, char **argv, OstreeCommandInvocation *invoc
return FALSE;
}
- current_deployments = ostree_sysroot_get_deployments (sysroot);
+ g_autoptr(GPtrArray) current_deployments = ostree_sysroot_get_deployments (sysroot);
- deploy_index_str = argv[1];
- deploy_index = atoi (deploy_index_str);
+ const char *deploy_index_str = argv[1];
+ int deploy_index = atoi (deploy_index_str);
- target_deployment = ot_admin_get_indexed_deployment (sysroot, deploy_index, error);
+ g_autoptr(OstreeDeployment) target_deployment =
+ ot_admin_get_indexed_deployment (sysroot, deploy_index, error);
if (!target_deployment)
return FALSE;