Skip to content

Commit

Permalink
context: avoid prefixing vars directories
Browse files Browse the repository at this point in the history
This drops the internal prefixing logic for vars directories, thus
avoiding the prepended `install_root` path prefix on all entries.
It also results in aligning the behaviors of `dnf_context_set_vars_dir()`
and `dnf_context_set_repos_dir()`.

Existing consumers in the wild are not really expecting this kind
of prefixing to happen internally. Additionally, developers seem to
naturally assume that the lookalike APIs for repos-dir and vars-dir
behave in the same way.

Ref: coreos/rpm-ostree#3241
Ref: https://github.com/PackageKit/PackageKit/pull/369/files#r863937752
Closes: rpm-software-management#1503
  • Loading branch information
lucab committed May 4, 2022
1 parent 1742be5 commit 88dcd7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libdnf/dnf-context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3785,7 +3785,7 @@ dnf_context_load_vars(DnfContext * context)
auto priv = GET_PRIVATE(context);
priv->vars->clear();
for (auto dir = dnf_context_get_vars_dir(context); *dir; ++dir)
ConfigMain::addVarsFromDir(*priv->vars, std::string(priv->install_root) + *dir);
ConfigMain::addVarsFromDir(*priv->vars, *dir);
ConfigMain::addVarsFromEnv(*priv->vars);
priv->varsCached = true;
}
Expand Down

0 comments on commit 88dcd7c

Please sign in to comment.