diff --git a/src/app/rpmostree-pkg-builtins.c b/src/app/rpmostree-pkg-builtins.c index 469a9c942c..a8b1a8a382 100644 --- a/src/app/rpmostree-pkg-builtins.c +++ b/src/app/rpmostree-pkg-builtins.c @@ -91,7 +91,8 @@ pkg_change (RpmOstreeCommandInvocation *invocation, g_variant_dict_insert (&dict, "reboot", "b", opt_reboot); g_variant_dict_insert (&dict, "cache-only", "b", opt_cache_only); g_variant_dict_insert (&dict, "download-only", "b", opt_download_only); - g_variant_dict_insert (&dict, "no-pull-base", "b", TRUE); + /* For historical reasons */ + g_variant_dict_insert (&dict, "no-pull-ostree-base", "b", TRUE); g_variant_dict_insert (&dict, "dry-run", "b", opt_dry_run); g_variant_dict_insert (&dict, "allow-inactive", "b", opt_allow_inactive); g_variant_dict_insert (&dict, "no-layering", "b", opt_uninstall_all); diff --git a/src/daemon/org.projectatomic.rpmostree1.xml b/src/daemon/org.projectatomic.rpmostree1.xml index 933e11c955..9754e7ac66 100644 --- a/src/daemon/org.projectatomic.rpmostree1.xml +++ b/src/daemon/org.projectatomic.rpmostree1.xml @@ -306,6 +306,8 @@ "no-pull-base" (type 'b') Do not pull a base layer from the remote. Not valid if either "set-refspec" or "set-revision" is specified. + "no-pull-ostree-base" (type 'b') + Like no-pull-base, but only applies if the base is via ostree://. "dry-run" (type 'b') Stop short of deploying the new tree. If layering packages, the pkg diff is printed but packages are not downloaded or diff --git a/src/daemon/rpmostreed-os.c b/src/daemon/rpmostreed-os.c index a8f34a5beb..ec97ed3d63 100644 --- a/src/daemon/rpmostreed-os.c +++ b/src/daemon/rpmostreed-os.c @@ -182,6 +182,8 @@ os_authorize_method (GDBusInterfaceSkeleton *interface, G_VARIANT_TYPE("ah")); gboolean no_pull_base = vardict_lookup_bool (&options_dict, "no-pull-base", FALSE); + gboolean no_pull_ostree_base = no_pull_base || + vardict_lookup_bool (&options_dict, "no-pull-ostree-base", FALSE); gboolean no_overrides = vardict_lookup_bool (&options_dict, "no-overrides", FALSE); gboolean no_layering = @@ -194,7 +196,7 @@ os_authorize_method (GDBusInterfaceSkeleton *interface, g_ptr_array_add (actions, "org.projectatomic.rpmostree1.rebase"); else if (revision != NULL) g_ptr_array_add (actions, "org.projectatomic.rpmostree1.deploy"); - else if (!no_pull_base) + else if (!no_pull_base && !no_pull_ostree_base) g_ptr_array_add (actions, "org.projectatomic.rpmostree1.upgrade"); if (install_pkgs != NULL || uninstall_pkgs != NULL || no_layering) diff --git a/src/daemon/rpmostreed-transaction-types.c b/src/daemon/rpmostreed-transaction-types.c index 1f5ecd68f0..e841fd07b7 100644 --- a/src/daemon/rpmostreed-transaction-types.c +++ b/src/daemon/rpmostreed-transaction-types.c @@ -793,6 +793,7 @@ deploy_transaction_execute (RpmostreedTransaction *transaction, /* Mainly for the `install` and `override` commands */ const gboolean no_pull_base = ((self->flags & RPMOSTREE_TRANSACTION_DEPLOY_FLAG_NO_PULL_BASE) > 0); + const gboolean no_pull_ostree_base = deploy_has_bool_option (self, "no-pull-ostree-base"); /* Used to background check for updates; this essentially means downloading the minimum * amount of metadata only to check if there's an upgrade */ const gboolean download_metadata_only = @@ -881,7 +882,7 @@ deploy_transaction_execute (RpmostreedTransaction *transaction, gboolean is_override = FALSE; /* In practice today */ - if (self->flags & RPMOSTREE_TRANSACTION_DEPLOY_FLAG_NO_PULL_BASE) + if (self->flags & RPMOSTREE_TRANSACTION_DEPLOY_FLAG_NO_PULL_BASE || no_pull_ostree_base) { /* this is a heuristic; by the end, once the proper switches are added, the two * commands can look indistinguishable at the D-Bus level */ @@ -1128,8 +1129,20 @@ deploy_transaction_execute (RpmostreedTransaction *transaction, rpmostree_transaction_set_title ((RPMOSTreeTransaction*)self, txn_title->str); rpmostree_sysroot_upgrader_set_origin (upgrader, origin); + RpmOstreeRefspecType refspec_type; + rpmostree_origin_classify_refspec (origin, &refspec_type, NULL); + /* Now that we have the refspec type, find out if we should be pulling + * the base. The idea here is that rojig defaults to pulling even for + * rpm-ostree install (which now uses `no-pull-ostree-base`), + * since the contents come from the same place. + * + * Perhaps we should be doing this for ostree as well...but I want + * to be conservative there for now. + */ + const gboolean no_pull = no_pull_base || + (no_pull_ostree_base && refspec_type == RPMOSTREE_REFSPEC_TYPE_OSTREE); - if (!no_pull_base) + if (!no_pull) { gboolean base_changed; @@ -1208,10 +1221,6 @@ deploy_transaction_execute (RpmostreedTransaction *transaction, changed = TRUE; } - /* Past this point we've computed the origin */ - RpmOstreeRefspecType refspec_type; - rpmostree_origin_classify_refspec (origin, &refspec_type, NULL); - if (download_metadata_only) { /* We have to short-circuit the usual path here; we already downloaded the ostree