summaryrefslogtreecommitdiff
path: root/src/ostree/ot-main.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-09-01 14:57:53 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2017-09-01 21:34:33 +0000
commit517dd9c9648f6d1508343429086ac5a471bea7ec (patch)
tree199dfa66ba7df7de5b03a74877ccc0e091c74d71 /src/ostree/ot-main.c
parentaef5a7331e112f4d8c3ce7ccc4abcc4b6c2a2c76 (diff)
downloadostree-517dd9c9648f6d1508343429086ac5a471bea7ec.tar.gz
bin/admin: Change init-fs to stop loading a sysroot to init one
This is exactly analogous to the `ostree init` case where we have `OSTREE_BUILTIN_FLAG_NO_REPO` to avoid trying to load a repo when we're creating one. Let's avoid the pointless sysroot for `init-fs`; among other things this will then let us do `ostree_sysroot_load()` inside the argument parsing, and drop it from every other user. Closes: #1123 Approved by: jlebon
Diffstat (limited to 'src/ostree/ot-main.c')
-rw-r--r--src/ostree/ot-main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index c8c3490e..48281c26 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -377,6 +377,13 @@ ostree_admin_option_context_parse (GOptionContext *context,
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)
+ {
+ g_assert_null (out_sysroot);
+ /* Early return if no sysroot is requested */
+ return TRUE;
+ }
+
g_autoptr(GFile) sysroot_path = NULL;
if (opt_sysroot != NULL)
sysroot_path = g_file_new_for_path (opt_sysroot);