summaryrefslogtreecommitdiff
path: root/src/ostree/ot-admin-builtin-pin.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2023-05-03 08:24:21 -0400
committerGitHub <noreply@github.com>2023-05-03 08:24:21 -0400
commit8a2993a9d01cc358e4c2d936ca132174aabdc714 (patch)
tree5402001ab710dadfd51ba3e9071b044016030e3e /src/ostree/ot-admin-builtin-pin.c
parentdd70c9b78cc34ccc7e638eda4c2df1ddd8ee3add (diff)
parentc1044a02b28982ef6dd58af98b23a40482d26487 (diff)
downloadostree-8a2993a9d01cc358e4c2d936ca132174aabdc714.tar.gz
Merge pull request #2565 from cgwalters/clang-format
Add .clang-format file + tree-wide: Run `clang-format`
Diffstat (limited to 'src/ostree/ot-admin-builtin-pin.c')
-rw-r--r--src/ostree/ot-admin-builtin-pin.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/src/ostree/ot-admin-builtin-pin.c b/src/ostree/ot-admin-builtin-pin.c
index 301e1aab..362df44c 100644
--- a/src/ostree/ot-admin-builtin-pin.c
+++ b/src/ostree/ot-admin-builtin-pin.c
@@ -21,27 +21,26 @@
#include <stdlib.h>
-#include "ot-main.h"
+#include "ostree.h"
#include "ot-admin-builtins.h"
#include "ot-admin-functions.h"
-#include "ostree.h"
+#include "ot-main.h"
#include "otutil.h"
static gboolean opt_unpin;
-static GOptionEntry options[] = {
- { "unpin", 'u', 0, G_OPTION_ARG_NONE, &opt_unpin, "Unset pin", NULL },
- { NULL }
-};
+static GOptionEntry options[]
+ = { { "unpin", 'u', 0, G_OPTION_ARG_NONE, &opt_unpin, "Unset pin", NULL }, { NULL } };
gboolean
-ot_admin_builtin_pin (int argc, char **argv, OstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error)
+ot_admin_builtin_pin (int argc, char **argv, OstreeCommandInvocation *invocation,
+ GCancellable *cancellable, GError **error)
{
- g_autoptr(GOptionContext) context = g_option_context_new ("INDEX");
- g_autoptr(OstreeSysroot) sysroot = NULL;
+ 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))
+ OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER, invocation, &sysroot,
+ cancellable, error))
return FALSE;
if (argc < 2)
@@ -62,7 +61,8 @@ ot_admin_builtin_pin (int argc, char **argv, OstreeCommandInvocation *invocation
if (errno == ERANGE)
return glnx_throw (error, "Index too large: %s", deploy_index_str);
- g_autoptr(OstreeDeployment) 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;
@@ -70,14 +70,17 @@ ot_admin_builtin_pin (int argc, char **argv, OstreeCommandInvocation *invocation
const gboolean desired_pin = !opt_unpin;
if (current_pin == desired_pin)
{
- g_print ("Deployment %s is already %s\n", deploy_index_str, current_pin ? "pinned" : "unpinned");
+ g_print ("Deployment %s is already %s\n", deploy_index_str,
+ current_pin ? "pinned" : "unpinned");
}
else
- {
- if (!ostree_sysroot_deployment_set_pinned (sysroot, target_deployment, desired_pin, error))
- return FALSE;
- g_print ("Deployment %s is now %s\n", deploy_index_str, desired_pin ? "pinned" : "unpinned");
- }
+ {
+ if (!ostree_sysroot_deployment_set_pinned (sysroot, target_deployment, desired_pin,
+ error))
+ return FALSE;
+ g_print ("Deployment %s is now %s\n", deploy_index_str,
+ desired_pin ? "pinned" : "unpinned");
+ }
}
return TRUE;