steamdeck-linux / decker

A Package Restore Helper for the Steam Deck.
GNU General Public License v3.0
33 stars 1 forks source link

pacman/yay -R/-S options #1

Open MunyuShizumi opened 2 years ago

MunyuShizumi commented 2 years ago

No Steam Deck yet (should arrive this week, fingers crossed), so this is a bit speculative but here's some questionable things I see:

How are updates handled?

I don't see pacman -Syu (or yay -Syu/yay) used anywhere. Does the Deck automagically run this for pacman somehow? Cause package lists won't get refreshed otherwise, so this may occasionally result in failed installs, and I'm personally not a fan of outdated packages.

Unneeded dependencies not being cleaned up after package removal

I think that pacman -Rs should be used at the very least, since -R doesn't remove auto-installed dependencies that are no longer required, and it's generally safe and extremely unlikely to result in issues. Orphaned dependencies could also be cleaned up independently later on, but there's essentially no reason not to -s them immediately.

Aside from that, removal may fail if the target package is a dependency, which is resolved e.g. via -Rsc but that may lead to inexperienced users recursively removing half the system by messing with certain packages. I personally use -Rcns, but I'm assuming this helper is aimed at less experiences users, so removing casually safeties on the nuclear warhead might not be the best idea. On the other hand, not using -c requires removing all dependent packages one by one which can be quite the hassle.

moxvallix commented 2 years ago

Yeah, updating has literally not been implemented yet. This script is not ready for actual usage at all. I have released it mainly in hope I can get some testers / help with development.

As for dependencies, you have raised some good points, and I feel this project may leave the scope of a bash script fairly quickly. In terms of removing half the system, I think we will make it only dependancies installed through decker should be able to be removed through decker.

But yeah, I need to give this more thought. Help making this script is also appreciated.

MunyuShizumi commented 2 years ago

In that case, -Rc is definitely too volatile, but -R will throw an error if the dependent packages aren't included, and resolving that is starting to resemble a basic package manager in itself. It might be mostly-ish safe if it's only used for packages manually installed through decker, but system dependencies may change over time, can't guarantee it won't bork something. I think decker might have to track all packages installed through it (including dependencies), but a pacman -Syu can break that as well if deps change.

-Rs should be safe though. E.g. if package pak has foo bar baz as dependencies, then removing pak with -s will try to remove foo bar baz only if they aren't dependencies elsewhere. If foo is needed by some other package, then only bar baz get (auto-)removed.
As long as all packages are flagged correctly, this shouldn't misfire, but I'll have to check what Valve is doing just in case.

I'll probably contribute a bit more once I get my Deck, or at least share random insights. Right now I can only help brainstorm things, don't have the spare time to test this in a VM. >.<