ex-container: Add --cache-only

Like the compose path; mostly doing this right now since I'm on a plane ✈.

Closes: #1026
Approved by: jlebon
This commit is contained in:
Colin Walters 2017-09-29 16:55:54 -04:00 committed by Atomic Bot
parent 70caa3b2da
commit d16d53ecae

View File

@ -42,7 +42,10 @@ static GOptionEntry init_option_entries[] = {
{ NULL } { NULL }
}; };
static gboolean opt_cache_only;
static GOptionEntry assemble_option_entries[] = { static GOptionEntry assemble_option_entries[] = {
{ "cache-only", 'C', 0, G_OPTION_ARG_NONE, &opt_cache_only, "Assume cache is present, do not attempt to update it", NULL },
{ NULL } { NULL }
}; };
@ -250,6 +253,10 @@ rpmostree_container_builtin_assemble (int argc,
if (!roc_context_prepare_for_root (rocctx, treespec, cancellable, error)) if (!roc_context_prepare_for_root (rocctx, treespec, cancellable, error))
return EXIT_FAILURE; return EXIT_FAILURE;
DnfContext *dnfctx = rpmostree_context_get_hif (rocctx->ctx);
if (opt_cache_only)
dnf_context_set_cache_age (dnfctx, G_MAXUINT);
/* --- Resolving dependencies --- */ /* --- Resolving dependencies --- */
if (!rpmostree_context_prepare (rocctx->ctx, cancellable, error)) if (!rpmostree_context_prepare (rocctx->ctx, cancellable, error))
return EXIT_FAILURE; return EXIT_FAILURE;