Hacker News new | ask | show | jobs
by mappu 452 days ago
Ubuntu (via Debian) already had a system for this in `update-alternatives`, which is almost certainly already installed on this person's system.

Would it be possible to toggle coreutils/uutils via that instead of reinventing it? They're both effectively symlinks-managers.

3 comments

They said elsewhere that they're not doing that yet because it requires coordination with the other package, and they don't want to bother until they're more confident that this doesn't utterly break things.
> `update-alternatives`

Also has at least one rewrite in rust:

https://github.com/Gregory-Meyer/update-alternatives

The alternatives system requires both packages to participate. In this case, a better alternative would be the diversions.
Unfortunately,

https://www.debian.org/doc/debian-policy/ap-pkg-diversions.h...

> Do not attempt to divert a file which is vitally important for the system’s operation - when using dpkg-divert there is a time, after it has been diverted but before dpkg has installed the new version, when the file does not exist.

I doubt that diversions are safe for coreutils. Now personally I'd like to know if that could be fixed instead of making a new tool, but /shrug