[ostree] Add OstreeAdminBuiltinFlags for admin commands
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] Add OstreeAdminBuiltinFlags for admin commands
- Date: Wed, 25 Mar 2015 21:25:38 +0000 (UTC)
commit e48ea0ba0592635cb2e5d2b51d2cd1cf37c2c5d1
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun Feb 22 15:41:02 2015 -0500
Add OstreeAdminBuiltinFlags for admin commands
Only OSTREE_ADMIN_BUILTIN_FLAG_NONE so far; does nothing.
src/ostree/ot-admin-builtin-cleanup.c | 4 +++-
src/ostree/ot-admin-builtin-deploy.c | 4 +++-
src/ostree/ot-admin-builtin-diff.c | 4 +++-
src/ostree/ot-admin-builtin-init-fs.c | 4 +++-
src/ostree/ot-admin-builtin-instutil.c | 4 +++-
src/ostree/ot-admin-builtin-os-init.c | 4 +++-
src/ostree/ot-admin-builtin-set-origin.c | 4 +++-
src/ostree/ot-admin-builtin-status.c | 4 +++-
src/ostree/ot-admin-builtin-switch.c | 4 +++-
src/ostree/ot-admin-builtin-undeploy.c | 4 +++-
src/ostree/ot-admin-builtin-upgrade.c | 4 +++-
.../ot-admin-instutil-builtin-grub2-generate.c | 4 +++-
...admin-instutil-builtin-selinux-ensure-labeled.c | 4 +++-
src/ostree/ot-admin-instutil-builtin-set-kargs.c | 4 +++-
src/ostree/ot-builtin-admin.c | 4 +++-
src/ostree/ot-main.c | 1 +
src/ostree/ot-main.h | 5 +++++
17 files changed, 51 insertions(+), 15 deletions(-)
---
diff --git a/src/ostree/ot-admin-builtin-cleanup.c b/src/ostree/ot-admin-builtin-cleanup.c
index be9aaf3..8607c11 100644
--- a/src/ostree/ot-admin-builtin-cleanup.c
+++ b/src/ostree/ot-admin-builtin-cleanup.c
@@ -43,7 +43,9 @@ ot_admin_builtin_cleanup (int argc, char **argv, GCancellable *cancellable, GErr
context = g_option_context_new ("Delete untagged deployments and repository objects");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (!ostree_sysroot_load (sysroot, cancellable, error))
diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c
index 6c4327b..6e6acfc 100644
--- a/src/ostree/ot-admin-builtin-deploy.c
+++ b/src/ostree/ot-admin-builtin-deploy.c
@@ -66,7 +66,9 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro
context = g_option_context_new ("REFSPEC - Checkout revision REFSPEC as the new default deployment");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (argc < 2)
diff --git a/src/ostree/ot-admin-builtin-diff.c b/src/ostree/ot-admin-builtin-diff.c
index 55a8911..be225d9 100644
--- a/src/ostree/ot-admin-builtin-diff.c
+++ b/src/ostree/ot-admin-builtin-diff.c
@@ -55,7 +55,9 @@ ot_admin_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError
g_option_context_add_main_entries (context, options, NULL);
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (!ostree_sysroot_load (sysroot, cancellable, error))
diff --git a/src/ostree/ot-admin-builtin-init-fs.c b/src/ostree/ot-admin-builtin-init-fs.c
index 9fe46f4..c6e76be 100644
--- a/src/ostree/ot-admin-builtin-init-fs.c
+++ b/src/ostree/ot-admin-builtin-init-fs.c
@@ -48,7 +48,9 @@ ot_admin_builtin_init_fs (int argc, char **argv, GCancellable *cancellable, GErr
context = g_option_context_new ("PATH - Initialize a root filesystem");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (argc < 2)
diff --git a/src/ostree/ot-admin-builtin-instutil.c b/src/ostree/ot-admin-builtin-instutil.c
index ba4d9b4..2d40487 100644
--- a/src/ostree/ot-admin-builtin-instutil.c
+++ b/src/ostree/ot-admin-builtin-instutil.c
@@ -116,7 +116,9 @@ ot_admin_builtin_instutil (int argc, char **argv, GCancellable *cancellable, GEr
context = ostree_admin_instutil_option_context_new_with_commands ();
/* This will not return for some options (e.g. --version). */
- if (ostree_admin_option_context_parse (context, NULL, &argc, &argv, NULL, cancellable, error))
+ if (ostree_admin_option_context_parse (context, NULL, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ NULL, cancellable, error))
{
if (subcommand_name == NULL)
{
diff --git a/src/ostree/ot-admin-builtin-os-init.c b/src/ostree/ot-admin-builtin-os-init.c
index 38a4de1..2927fe7 100644
--- a/src/ostree/ot-admin-builtin-os-init.c
+++ b/src/ostree/ot-admin-builtin-os-init.c
@@ -46,7 +46,9 @@ ot_admin_builtin_os_init (int argc, char **argv, GCancellable *cancellable, GErr
context = g_option_context_new ("OSNAME - Initialize empty state for given operating system");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (!ostree_sysroot_ensure_initialized (sysroot, cancellable, error))
diff --git a/src/ostree/ot-admin-builtin-set-origin.c b/src/ostree/ot-admin-builtin-set-origin.c
index 3beed86..21d8ac9 100644
--- a/src/ostree/ot-admin-builtin-set-origin.c
+++ b/src/ostree/ot-admin-builtin-set-origin.c
@@ -55,7 +55,9 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G
context = g_option_context_new ("REMOTENAME URL [BRANCH]");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (argc < 3)
diff --git a/src/ostree/ot-admin-builtin-status.c b/src/ostree/ot-admin-builtin-status.c
index 382c5e6..d0b1aed 100644
--- a/src/ostree/ot-admin-builtin-status.c
+++ b/src/ostree/ot-admin-builtin-status.c
@@ -62,7 +62,9 @@ ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GErro
context = g_option_context_new ("List deployments");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (!ostree_sysroot_load (sysroot, cancellable, error))
diff --git a/src/ostree/ot-admin-builtin-switch.c b/src/ostree/ot-admin-builtin-switch.c
index ff9d6e9..7cfaebf 100644
--- a/src/ostree/ot-admin-builtin-switch.c
+++ b/src/ostree/ot-admin-builtin-switch.c
@@ -68,7 +68,9 @@ ot_admin_builtin_switch (int argc, char **argv, GCancellable *cancellable, GErro
context = g_option_context_new ("REF - Construct new tree from current origin and deploy it, if it
changed");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (argc < 2)
diff --git a/src/ostree/ot-admin-builtin-undeploy.c b/src/ostree/ot-admin-builtin-undeploy.c
index 9196e5b..be864b1 100644
--- a/src/ostree/ot-admin-builtin-undeploy.c
+++ b/src/ostree/ot-admin-builtin-undeploy.c
@@ -46,7 +46,9 @@ ot_admin_builtin_undeploy (int argc, char **argv, GCancellable *cancellable, GEr
context = g_option_context_new ("INDEX - Delete deployment INDEX");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (argc < 2)
diff --git a/src/ostree/ot-admin-builtin-upgrade.c b/src/ostree/ot-admin-builtin-upgrade.c
index 5ccd0b3..a1e4aa3 100644
--- a/src/ostree/ot-admin-builtin-upgrade.c
+++ b/src/ostree/ot-admin-builtin-upgrade.c
@@ -67,7 +67,9 @@ ot_admin_builtin_upgrade (int argc, char **argv, GCancellable *cancellable, GErr
context = g_option_context_new ("Construct new tree from current origin and deploy it, if it changed");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (!ostree_sysroot_load (sysroot, cancellable, error))
diff --git a/src/ostree/ot-admin-instutil-builtin-grub2-generate.c
b/src/ostree/ot-admin-instutil-builtin-grub2-generate.c
index 617b160..3af1f34 100644
--- a/src/ostree/ot-admin-instutil-builtin-grub2-generate.c
+++ b/src/ostree/ot-admin-instutil-builtin-grub2-generate.c
@@ -47,7 +47,9 @@ ot_admin_instutil_builtin_grub2_generate (int argc, char **argv, GCancellable *c
context = g_option_context_new ("[BOOTVERSION] - generate GRUB2 configuration from given BLS entries");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (argc >= 2)
diff --git a/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
b/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
index 7e9ca06..130cf3b 100644
--- a/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
+++ b/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
@@ -194,7 +194,9 @@ ot_admin_instutil_builtin_selinux_ensure_labeled (int argc, char **argv, GCancel
context = g_option_context_new ("[SUBPATH PREFIX] - relabel all or part of a deployment");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (!ostree_sysroot_load (sysroot, cancellable, error))
diff --git a/src/ostree/ot-admin-instutil-builtin-set-kargs.c
b/src/ostree/ot-admin-instutil-builtin-set-kargs.c
index cef5242..9bbad88 100644
--- a/src/ostree/ot-admin-instutil-builtin-set-kargs.c
+++ b/src/ostree/ot-admin-instutil-builtin-set-kargs.c
@@ -56,7 +56,9 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel
context = g_option_context_new ("ARGS - set new kernel command line arguments");
- if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+ if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ &sysroot, cancellable, error))
goto out;
if (!ostree_sysroot_load (sysroot, cancellable, error))
diff --git a/src/ostree/ot-builtin-admin.c b/src/ostree/ot-builtin-admin.c
index b194143..6cc6384 100644
--- a/src/ostree/ot-builtin-admin.c
+++ b/src/ostree/ot-builtin-admin.c
@@ -130,7 +130,9 @@ ostree_builtin_admin (int argc, char **argv, GCancellable *cancellable, GError *
context = ostree_admin_option_context_new_with_commands ();
/* This will not return for some options (e.g. --version). */
- if (ostree_admin_option_context_parse (context, NULL, &argc, &argv, NULL, cancellable, error))
+ if (ostree_admin_option_context_parse (context, NULL, &argc, &argv,
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+ NULL, cancellable, error))
{
if (subcommand_name == NULL)
{
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index 94d29ca..b1ad20e 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -308,6 +308,7 @@ ostree_admin_option_context_parse (GOptionContext *context,
const GOptionEntry *main_entries,
int *argc,
char ***argv,
+ OstreeAdminBuiltinFlags flags,
OstreeSysroot **out_sysroot,
GCancellable *cancellable,
GError **error)
diff --git a/src/ostree/ot-main.h b/src/ostree/ot-main.h
index 659727f..b1c58a0 100644
--- a/src/ostree/ot-main.h
+++ b/src/ostree/ot-main.h
@@ -30,6 +30,10 @@ typedef enum {
OSTREE_BUILTIN_FLAG_NO_CHECK = 1 << 1
} OstreeBuiltinFlags;
+typedef enum {
+ OSTREE_ADMIN_BUILTIN_FLAG_NONE = 0,
+} OstreeAdminBuiltinFlags;
+
typedef struct {
const char *name;
gboolean (*fn) (int argc, char **argv, GCancellable *cancellable, GError **error);
@@ -49,6 +53,7 @@ gboolean ostree_option_context_parse (GOptionContext *context,
gboolean ostree_admin_option_context_parse (GOptionContext *context,
const GOptionEntry *main_entries,
int *argc, char ***argv,
+ OstreeAdminBuiltinFlags flags,
OstreeSysroot **out_sysroot,
GCancellable *cancellable, GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]