Skip to content

Commit

Permalink
nevra_to_selector: default to package name
Browse files Browse the repository at this point in the history
In #204, we changed `dnf_context_install()` so that it accepts any
allowed subject forms, defaulting to a provides if just a package name
is given. However, interpreting it as a provides can cause libsolv to
make suboptimal choices: openSUSE/libsolv#165

It seems safer in that case to just revert to HY_PKG_NAME instead, which
was the same behaviour as before #204.

Closes: #220

Closes: #224
Approved by: cgwalters
  • Loading branch information
jlebon authored and DNF Bot committed Dec 5, 2016
1 parent f9b798c commit 96b9f99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libdnf/hy-subject.c
Expand Up @@ -299,7 +299,7 @@ nevra_to_selector(HyNevra nevra, DnfSack *sack)
HySelector selector = hy_selector_create(sack);

if (hy_nevra_has_just_name(nevra)) {
hy_selector_set(selector, HY_PKG_PROVIDES, HY_EQ,
hy_selector_set(selector, HY_PKG_NAME, HY_EQ,
hy_nevra_get_string(nevra, HY_NEVRA_NAME));
} else {
const char *str = hy_nevra_get_string(nevra, HY_NEVRA_NAME);
Expand Down

0 comments on commit 96b9f99

Please sign in to comment.