Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify solver_describe_decision to report cleaned (RhBug:1486749) #325

Closed
wants to merge 1 commit into from

Conversation

j-mracek
Copy link
Member

If the package in cleandeps it will return SOLVER_REASON_CLEANDEPS_ERASE.

https://bugzilla.redhat.com/show_bug.cgi?id=1486749

@j-mracek
Copy link
Member Author

Important!!! it requires upstream version of libsolv - may be 0.6.30

libdnf/hy-goal.c Outdated
@@ -1381,7 +1381,7 @@ hy_goal_get_reason(HyGoal goal, DnfPackage *pkg)
//solver_get_recommendations
if (goal->solv == NULL)
return HY_REASON_USER;
Id info;
Id info, pkg_id;
int reason = solver_describe_decision(goal->solv, dnf_package_get_id(pkg), &info);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small optimalization :-) Call dnf_package_get_id(pkg) only once.

const Id pkg_id = dnf_package_get_id(pkg);
Id info;
int reason = solver_describe_decision(goal->solv, pkg_id, &info);

and remove line 1399 pkg_id = dnf_package_get_id(pkg);

libdnf/hy-goal.c Outdated
queue_free(&cleandepsq);
return HY_REASON_CLEAN;
}
}
return HY_REASON_DEP;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memory leak. Missing queue_free(&cleandepsq); before return.

@ignatenkobrain
Copy link
Contributor

@rh-atomic-bot r+

@rh-atomic-bot
Copy link

📌 Commit f366c03 has been approved by ignatenkobrain

@rh-atomic-bot
Copy link

⌛ Testing commit f366c03 with merge b534bb2...

@rh-atomic-bot
Copy link

☀️ Test successful - status-papr
Approved by: ignatenkobrain
Pushing b534bb2 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants