-
Notifications
You must be signed in to change notification settings - Fork 40
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
pkgin should be able to rm named packages without dependencies #48
Comments
Could you give me an example? I'm not entirely sure what you're asking. Thanks. |
What I mean is:
except that I don't want Once I have my keep flags set, I find |
Ok. This is definitely something I do not want pkgin to support, certainly the first behaviour, and absolutely never by default, as it should never knowingly create a broken system. Advanced users who know what they're doing can just use I can maybe see some merit in showing if a package to be deleted has any dependents, and maybe if others feel strongly about this I could consider an optional argument to |
I did not mean leading to a broken system at all. I completely agree that no broken states should ever result. I just mean 'pkgin rm foo' either can safely remove foo without recursing and does so, exiting 0, or cannot safely do so, prints an error, and exits 1. I guess a more fundamental question might be: is it an error for pkgin to be called from a script, without a human to answer questions, or to be called like |
It's reasonably fair. Given that pkgin is primarily a wrapper around pkg_install, it's certainly the case that it is tailored towards interactive use and providing the user options and features that are not supported by pkg_install. For any advanced usage such as pipelines I personally would lean towards using pkg_install (in this case That said there is some merit in having an option e.g. |
On one hand I am sympathetic to the "document that using it non-interactively is a bug", but pkgin also does a lot of cross-pkg dependency management that pkg_install cannot do. After this discussion I lean to:
Right now it feels like one should be able to call it non-interactively, but it doesn't really work. |
Just to be clear that using it non-interactively is emphatically not a bug, the disagreement is only in the behaviour that should occur where the expectation perhaps differs from what regular users would expect. Both pkgin is used by a number of provisioning / configuration management systems (ansible, salt, etc.) where it is always called non-interactively and we encourage its continued use in those tools. |
I guess then my residual issue is that calling it with /dev/null stdin leads to it trying to read to answer questions and printing odd complaints. So perhaps a way forward is that if stdin is not a tty, then 1) don't ask the question and 2) do what should be done for a script if that is safe. I don't see recursive rm as safe, but I do see "i asked to install foo, and foo and 3 deps are installed" as safe. That leaves the behavior with a tty the same, and makes it more script friendly. |
Or if -n is supposed to be used for this, then not giving -n can be an error if not tty. using pkgin in shell scripts without that has frequently led me to confusion. |
Yeh certainly if there are areas where stdin isn't working then we should fix those. |
ok, will file new point bugs as I find it, and thanks for the polite discussion! |
I'd like to be able to remove a package or set of packges, and have that just work if it can be removed, and just fail with an error if it cannot (due to a dependency still being there). As it is I have to parse the suggested output, and this basically requires pkgin to be used interactively.
Perhaps I should use pkg_delete instead, and it's an error to use the human tool for machine operations.
The text was updated successfully, but these errors were encountered: