diff --git a/src/ostree/ot-builtin-commit.c b/src/ostree/ot-builtin-commit.c index cd9e9a9f..db17f538 100644 --- a/src/ostree/ot-builtin-commit.c +++ b/src/ostree/ot-builtin-commit.c @@ -313,6 +313,9 @@ ostree_builtin_commit (int argc, char **argv, GCancellable *cancellable, GError if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error)) goto out; + if (!ostree_ensure_repo_writable (repo, error)) + goto out; + if (opt_statoverride_file) { if (!parse_statoverride_file (&mode_adds, cancellable, error)) diff --git a/src/ostree/ot-builtin-prune.c b/src/ostree/ot-builtin-prune.c index cd05b2f3..89ad2e5d 100644 --- a/src/ostree/ot-builtin-prune.c +++ b/src/ostree/ot-builtin-prune.c @@ -55,6 +55,9 @@ ostree_builtin_prune (int argc, char **argv, GCancellable *cancellable, GError * if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error)) goto out; + if (!opt_no_prune && !ostree_ensure_repo_writable (repo, error)) + goto out; + if (opt_refs_only) pruneflags |= OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY; if (opt_no_prune) diff --git a/src/ostree/ot-builtin-pull-local.c b/src/ostree/ot-builtin-pull-local.c index 4588ccb0..2b7bf67c 100644 --- a/src/ostree/ot-builtin-pull-local.c +++ b/src/ostree/ot-builtin-pull-local.c @@ -58,6 +58,9 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error)) goto out; + if (!ostree_ensure_repo_writable (repo, error)) + goto out; + if (argc < 2) { gchar *help = g_option_context_get_help (context, TRUE, NULL); diff --git a/src/ostree/ot-builtin-pull.c b/src/ostree/ot-builtin-pull.c index 08466054..91db17d1 100644 --- a/src/ostree/ot-builtin-pull.c +++ b/src/ostree/ot-builtin-pull.c @@ -57,6 +57,9 @@ ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError ** if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error)) goto out; + if (!ostree_ensure_repo_writable (repo, error)) + goto out; + if (argc < 2) { ot_util_usage_error (context, "REMOTE must be specified", error); diff --git a/src/ostree/ot-builtin-reset.c b/src/ostree/ot-builtin-reset.c index 0a72846d..a09e9a4f 100644 --- a/src/ostree/ot-builtin-reset.c +++ b/src/ostree/ot-builtin-reset.c @@ -100,6 +100,9 @@ ostree_builtin_reset (int argc, if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error)) goto out; + if (!ostree_ensure_repo_writable (repo, error)) + goto out; + if (argc <= 2) { ot_util_usage_error (context, "A ref and commit argument is required", error); diff --git a/src/ostree/ot-builtin-static-delta.c b/src/ostree/ot-builtin-static-delta.c index eba852fc..9eece842 100644 --- a/src/ostree/ot-builtin-static-delta.c +++ b/src/ostree/ot-builtin-static-delta.c @@ -140,6 +140,9 @@ ot_static_delta_builtin_generate (int argc, char **argv, GCancellable *cancellab if (!ostree_option_context_parse (context, generate_options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error)) goto out; + if (!ostree_ensure_repo_writable (repo, error)) + goto out; + if (argc >= 3 && opt_to_rev == NULL) opt_to_rev = argv[2]; @@ -248,6 +251,9 @@ ot_static_delta_builtin_apply_offline (int argc, char **argv, GCancellable *canc if (!ostree_option_context_parse (context, apply_offline_options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error)) goto out; + if (!ostree_ensure_repo_writable (repo, error)) + goto out; + if (argc < 3) { g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, diff --git a/src/ostree/ot-builtin-summary.c b/src/ostree/ot-builtin-summary.c index d7bed442..81566898 100644 --- a/src/ostree/ot-builtin-summary.c +++ b/src/ostree/ot-builtin-summary.c @@ -46,6 +46,9 @@ ostree_builtin_summary (int argc, char **argv, GCancellable *cancellable, GError if (opt_update) { + if (!ostree_ensure_repo_writable (repo, error)) + goto out; + if (!ostree_repo_regenerate_summary (repo, NULL, cancellable, error)) goto out; }