Skip to content

Commit

Permalink
Separate output of requires and requires_pre (RhBug:1543449)
Browse files Browse the repository at this point in the history
For idarray "requires" and marker=0 libsolv returns Queue containing
regular requires than special entry SOLVABLE_PREREQMARKER and then
requires for pre/post/preun/postun.

By just removing the special entry SOLVABLE_PREREQMARKER we basically
lose information whether some require is a regular require, prerequire
or both. This information is needed to correctly assess dnf check
dependencies.

https://bugzilla.redhat.com/show_bug.cgi?id=1543449
  • Loading branch information
kontura authored and j-mracek committed Mar 5, 2020
1 parent 114f2a7 commit b4c8d7a
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions libdnf/hy-package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,32 +145,23 @@ reldeps_for(DnfPackage *pkg, Id type)
{
Solvable *s = get_solvable(pkg);
DnfReldepList *reldeplist;
Queue q, q_final;
Queue q;
Id marker = -1;
Id solv_type = type;
Id rel_id;

if (type == SOLVABLE_REQUIRES)
marker = 0;
marker = -1;

if (type == SOLVABLE_PREREQMARKER) {
solv_type = SOLVABLE_REQUIRES;
marker = 1;
}
queue_init(&q);
queue_init(&q_final);
solvable_lookup_deparray(s, solv_type, &q, marker);

for (int i = 0; i < q.count; i++) {
rel_id = q.elements[i];
if (rel_id != SOLVABLE_PREREQMARKER)
queue_push(&q_final, rel_id);
}

reldeplist = new libdnf::DependencyContainer(dnf_package_get_sack(pkg), q_final);
reldeplist = new libdnf::DependencyContainer(dnf_package_get_sack(pkg), q);

queue_free(&q);
queue_free(&q_final);
return reldeplist;
}

Expand Down

0 comments on commit b4c8d7a

Please sign in to comment.