Comments (6)
When I ran it, it did indeed delete 77 packages.
The next call to pkgin rm \*
only offers deleting of two packages, libreoffice and zxing-cpp.
The next one says it will remove 51, some leaf packages, but also (most? all? of) qt5.
The next run offered only zsh-autosuggestions; I tried pkgin ar
at that point and it offered to delete 281 packages.
I don't see the pattern.
from pkgin.
After the pkgin ar
, pkgin rm
still offered only to delete zsh-autosuggestion; after that, zsh, then 1-6 packages each time I started it.
from pkgin.
Wow.
from pkgin.
Firstly, what's happening here is that pkgin operates on package matches, not globs. If you ask to install or remove *
, it will try to find the best package match for your pattern, there's no concept of expanding globs. The package it chooses will be dependent on the ordering in the local package repository but likely reverse alphabetical (hence picking z*
in your case), and the numbering will be based on how many dependent packages it will have to remove along with the one that matched.
I think that fundamentally we can't support globs like this, due to the way pkgsrc pattern matching works. Consider patterns like vim{,-xaw}
: in pkgsrc context that means either vim
or vim-xaw
, but not both. While we could add hacky hardcoding of *
to mean all packages, I'm not sure it makes for a orthogonal user experience, and I'm leaning more towards adding a clear paragraph or two about this in the man page.
Finally, trying to perform a hypothetical pkgin rm '*'
wouldn't necessarily work anyway, or be desirable, as there will be packages such pkg_install
that cannot be removed, as well as preserve packages that will not be auto-removed. Plus, you'd end up with removing pkgin
itself and being unable to recover without resorting to pkg_add
(along with potential for issues on platforms where the binary has been removed from out underneath you), and if you are a user who is comfortable doing that then you're probably going to be using pkg_delete -f '*'
or similar instead anyway.
I'll leave this open though until the docs are clearer, and if there are a lot of strong opinions that *
should work, along with clarity on what should be expected if used for e.g. pkgin install
, then I'm happy to reevaluate.
from pkgin.
Thanks for the explanation. That makes it a bit clearer what happens, though I'm still baffled by the amount of packages deleted each time - if it chooses the 'best match' as you say, why doesn't it always just delete one?
I think documenting this in more detail is probably enough to close this issue, otherwise.
Just to give some bigger view: My use case was reinstalling all packages after an OS upgrade, using a pre-existing package list (that can be used to pkgin import
), to make sure only the wanted packages are installed (and not other packages that were installed for testing and forgotten), and they are at the newest version and for the right operating system version, while leaving the changed configuration files alone.
Now that the pkgdb is inside PREFIX, the best method I have for this is to move the old PREFIX aside and install in a new one, but then I have to copy the configuration files manually.
If you have a better suggestion, please let me know. Thanks.
from pkgin.
Thanks for the explanation. That makes it a bit clearer what happens, though I'm still baffled by the amount of packages deleted each time - if it chooses the 'best match' as you say, why doesn't it always just delete one?
It only chooses one, but the list of packages will also include any packages that are reverse dependencies of that package, and will also be removed to ensure consistency.
I'm hoping to make this clearer in future releases by separating out packages and dependencies.
If you have a better suggestion, please let me know. Thanks.
pkgin list | awk '{print $1}' | xargs pkgin rm
or so should work for now. In the future it might be interesting to have a similar command to import
but one that ensures that only the listed packages and their dependencies are installed.
from pkgin.
Related Issues (20)
- "upgrade" does not warn about missing packages in repo HOT 3
- partial upgrades are confusing, and man page does not explain what upgrade means HOT 7
- verbose mode is completely wrong
- Category parsing needs to be improved
- Multiple users running install at the same time corrupts the pkgin database
- Incorrect version comparison logic HOT 2
- pkgin struggling with nodejs's multiple version HOT 5
- pkgin should allow user prioritizing of pkg_summary archive formats HOT 2
- deinstall does not order packages correctly HOT 8
- inconsistency in output HOT 7
- pkgin leaks memory quadratically HOT 1
- Upgrade will install unnecessary packages HOT 7
- ohloh thin badge does not load on pkgin website HOT 1
- Download packages in parallel
- Dependent packages should only be upgraded once HOT 2
- [Feature Request] Add retry when download fails during install
- man page nits HOT 2
- configure.ac wrongly checks for header files in build environment
- Flavors: How to preserve specific optionality in pkgsrc builds? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pkgin.