Skip to content

Commit

Permalink
tree-wide: s/hif/dnf/
Browse files Browse the repository at this point in the history
No real particular reason, just decided to do this while the outstanding patches
don't conflict too much.

Closes: #1106
Approved by: jlebon
  • Loading branch information
cgwalters authored and rh-atomic-bot committed Nov 17, 2017
1 parent 1240d8d commit 7ab8869
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 83 deletions.
26 changes: 13 additions & 13 deletions src/app/rpmostree-compose-builtin-tree.c
Expand Up @@ -329,9 +329,9 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
return FALSE;
#endif

DnfContext *hifctx = rpmostree_context_get_hif (self->corectx);
DnfContext *dnfctx = rpmostree_context_get_dnf (self->corectx);
if (opt_proxy)
dnf_context_set_http_proxy (hifctx, opt_proxy);
dnf_context_set_http_proxy (dnfctx, opt_proxy);

/* Hack this here... see https://github.com/rpm-software-management/libhif/issues/53
* but in the future we won't be using librpm at all for unpack/scripts, so it won't
Expand All @@ -340,24 +340,24 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
{ const char *debuglevel = getenv ("RPMOSTREE_RPM_VERBOSITY");
if (!debuglevel)
debuglevel = "info";
dnf_context_set_rpm_verbosity (hifctx, debuglevel);
dnf_context_set_rpm_verbosity (dnfctx, debuglevel);
rpmlogSetFile(NULL);
}

GFile *contextdir = self->treefile_context_dirs->pdata[0];
dnf_context_set_repo_dir (hifctx, gs_file_get_path_cached (contextdir));
dnf_context_set_repo_dir (dnfctx, gs_file_get_path_cached (contextdir));

/* By default, retain packages in addition to metadata with --cachedir */
if (opt_cachedir)
dnf_context_set_keep_cache (hifctx, TRUE);
dnf_context_set_keep_cache (dnfctx, TRUE);
/* For compose, always try to refresh metadata; we're used in build servers
* where fetching should be cheap. Otherwise, if --cache-only is set, it's
* likely an offline developer laptop case, so never refresh.
*/
if (!opt_cache_only)
dnf_context_set_cache_age (hifctx, 0);
dnf_context_set_cache_age (dnfctx, 0);
else
dnf_context_set_cache_age (hifctx, G_MAXUINT);
dnf_context_set_cache_age (dnfctx, G_MAXUINT);

g_autoptr(GKeyFile) treespec = g_key_file_new ();
g_key_file_set_string (treespec, "tree", "ref", self->ref);
Expand Down Expand Up @@ -415,15 +415,15 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
if (!rpmostree_context_prepare (self->corectx, cancellable, error))
return FALSE;

rpmostree_print_transaction (hifctx);
rpmostree_print_transaction (dnfctx);

JsonArray *add_files = NULL;
if (json_object_has_member (treedata, "add-files"))
add_files = json_object_get_array_member (treedata, "add-files");

/* FIXME - just do a depsolve here before we compute download requirements */
g_autofree char *ret_new_inputhash = NULL;
if (!compute_checksum_from_treefile_and_goal (self, dnf_context_get_goal (hifctx),
if (!compute_checksum_from_treefile_and_goal (self, dnf_context_get_goal (dnfctx),
contextdir, add_files,
&ret_new_inputhash, error))
return FALSE;
Expand Down Expand Up @@ -513,8 +513,8 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
if (!libcontainer_prep_dev (rootfs_dfd, error))
return FALSE;

if (!dnf_transaction_commit (dnf_context_get_transaction (hifctx),
dnf_context_get_goal (hifctx),
if (!dnf_transaction_commit (dnf_context_get_transaction (dnfctx),
dnf_context_get_goal (dnfctx),
hifstate,
error))
return FALSE;
Expand Down Expand Up @@ -769,7 +769,7 @@ rpm_ostree_compose_context_new (const char *treefile_pathstr,
return FALSE;


g_autoptr(GHashTable) varsubsts = rpmostree_dnfcontext_get_varsubsts (rpmostree_context_get_hif (self->corectx));
g_autoptr(GHashTable) varsubsts = rpmostree_dnfcontext_get_varsubsts (rpmostree_context_get_dnf (self->corectx));
const char *input_ref = _rpmostree_jsonutil_object_require_string_member (self->treefile, "ref", error);
if (!input_ref)
return FALSE;
Expand Down Expand Up @@ -885,7 +885,7 @@ impl_install_tree (RpmOstreeTreeComposeContext *self,
if (!_rpmostree_jsonutil_append_string_array_to (self->treefile, "packages", packages, error))
return FALSE;

{ g_autofree char *thisarch_packages = g_strconcat ("packages-", dnf_context_get_base_arch (rpmostree_context_get_hif (self->corectx)), NULL);
{ g_autofree char *thisarch_packages = g_strconcat ("packages-", dnf_context_get_base_arch (rpmostree_context_get_dnf (self->corectx)), NULL);

if (json_object_has_member (self->treefile, thisarch_packages))
{
Expand Down
6 changes: 3 additions & 3 deletions src/app/rpmostree-container-builtins.c
Expand Up @@ -286,15 +286,15 @@ rpmostree_container_builtin_assemble (int argc,
if (!roc_context_prepare_for_root (rocctx, treespec, cancellable, error))
return EXIT_FAILURE;

DnfContext *dnfctx = rpmostree_context_get_hif (rocctx->ctx);
DnfContext *dnfctx = rpmostree_context_get_dnf (rocctx->ctx);
if (opt_cache_only)
dnf_context_set_cache_age (dnfctx, G_MAXUINT);

/* --- Resolving dependencies --- */
if (!rpmostree_context_prepare (rocctx->ctx, cancellable, error))
return EXIT_FAILURE;

rpmostree_print_transaction (rpmostree_context_get_hif (rocctx->ctx));
rpmostree_print_transaction (rpmostree_context_get_dnf (rocctx->ctx));

g_autofree char *commit = NULL;
if (!download_rpms_and_assemble_commit (rocctx, &commit, cancellable, error))
Expand Down Expand Up @@ -454,7 +454,7 @@ rpmostree_container_builtin_upgrade (int argc, char **argv,
if (!rpmostree_context_prepare (rocctx->ctx, cancellable, error))
return EXIT_FAILURE;

rpmostree_print_transaction (rpmostree_context_get_hif (rocctx->ctx));
rpmostree_print_transaction (rpmostree_context_get_dnf (rocctx->ctx));

{
g_autofree char *new_state_sha512 = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/rpmostree-sysroot-upgrader.c
Expand Up @@ -847,7 +847,7 @@ prep_local_assembly (RpmOstreeSysrootUpgrader *self,
if (self->flags & RPMOSTREE_SYSROOT_UPGRADER_FLAGS_DRY_RUN)
{
if (have_packages)
rpmostree_print_transaction (rpmostree_context_get_hif (self->ctx));
rpmostree_print_transaction (rpmostree_context_get_dnf (self->ctx));
}

/* If the current state has layering, compare the depsolved set for changes. */
Expand Down
4 changes: 2 additions & 2 deletions src/daemon/rpmostreed-transaction-types.c
Expand Up @@ -1359,8 +1359,8 @@ refresh_md_transaction_execute (RpmostreedTransaction *transaction,

if (self->flags & RPMOSTREE_TRANSACTION_REFRESH_MD_FLAG_FORCE)
{
DnfContext *hifctx = rpmostree_context_get_hif (ctx);
dnf_context_set_cache_age (hifctx, 0);
DnfContext *dnfctx = rpmostree_context_get_dnf (ctx);
dnf_context_set_cache_age (dnfctx, 0);
}

/* point libdnf to our repos dir */
Expand Down

0 comments on commit 7ab8869

Please sign in to comment.