-
Notifications
You must be signed in to change notification settings - Fork 1
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
We may not want to raise NoPackageFound
when trying to remove non-existing package
#136
Comments
Why wouldn't we? |
good question :) It is a bit difficult to handle the case of the user asking to remove something that is not installed. Actually, it is not right now, as we assume "name == provide", but that may not be trivial anymore later on. So I think there should be a way in satsolver to easily notify the solver consumer that a package about to be removed cannot be found (different exception, maybe subclass ot NoPackageFound), or at least an API to check this case, so that we can give a meaningful error to the user. |
The sat-solver is not who determines which package is which, though. That comes from the outside in the form of a bunch of repositories of PackageMetadata instances that are constructed by whoever knows what is available upstream, right? |
If you refer to providers, then the solver itself would not know, but the for job in request.jobs:
if job.kind == JobKind.remove:
candidates = pool.what_provides(job.requirement)
if len(candidates) == 0:
# no candidate at all, likely a user error
else:
for candidate in candidates:
if candidate in installed_repository:
break
else:
# the package is available but is not installed I think doing this check in solve kinda makes sense ? |
How does the pool find out what provides what if it does not come from upstream? |
We can have different errors for "non-existent package" vs "can't uninstall package that isn't installed," but in either case, this isn't really a solver issue, I would think. Upstream knows what's installed before it ever invokes the solver. |
@johntyree what do you think ?
The text was updated successfully, but these errors were encountered: