summaryrefslogtreecommitdiff
path: root/src/ostree/ot-main.c
diff options
context:
space:
mode:
authorJonathan Lebon <jlebon@redhat.com>2017-09-08 15:40:59 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2017-09-13 14:32:20 +0000
commit4c02fc2daa7c433c095b1757d630836d75b974db (patch)
tree6a1bf11180a1094a358b4ce7e16ee9df8e13d048 /src/ostree/ot-main.c
parent225bbdf0024a4325dcda273cce135912f6217824 (diff)
downloadostree-4c02fc2daa7c433c095b1757d630836d75b974db.tar.gz
bin/admin: Don't load sysroot for root commands
There's no need to load the sysroot for root commands which have subcommands, like `ostree admin` and `ostree admin instutil`. Otherwise, even just calling them without arguments will cause a failure. The subcommands will have the appropriate flags set as needed. Closes: #1126 Approved by: cgwalters
Diffstat (limited to 'src/ostree/ot-main.c')
-rw-r--r--src/ostree/ot-main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index eda787b4..a6ddfe74 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -374,10 +374,11 @@ ostree_admin_option_context_parse (GOptionContext *context,
g_option_context_add_main_entries (context, global_admin_entries, NULL);
- if (!ostree_option_context_parse (context, main_entries, argc, argv, OSTREE_BUILTIN_FLAG_NO_REPO, NULL, cancellable, error))
+ if (!ostree_option_context_parse (context, main_entries, argc, argv,
+ OSTREE_BUILTIN_FLAG_NO_REPO, NULL, cancellable, error))
return FALSE;
- if (flags & OSTREE_ADMIN_BUILTIN_FLAG_NO_SYSROOT)
+ if (!opt_print_current_dir && (flags & OSTREE_ADMIN_BUILTIN_FLAG_NO_SYSROOT))
{
g_assert_null (out_sysroot);
/* Early return if no sysroot is requested */