rvm / ubuntu_rvm

Ubuntu package for RVM
https://launchpad.net/~rael-gc/+archive/ubuntu/rvm
Apache License 2.0
694 stars 84 forks source link

Do not remove `/rubies/` and other pristine/cached data on `remove` #55

Open stdedos opened 3 years ago

stdedos commented 3 years ago

https://github.com/rvm/ubuntu_rvm/blob/f6da3a5fb8753859a7458e56cc25ad289ec12e76/debian/postrm#L25-L27

This is why we have apt-get purge / apt-get remove --purge.

PS: I don't know what happens on apt-get install --reinstall.

raelgc commented 3 years ago

Hi @stdedos and thanks for opening this issue.

As you can see in the mentioned file, the Ubuntu package removing only:

Before the these, we run rvm implode in prerm, which deletes rubies too.

https://github.com/rvm/ubuntu_rvm/blob/f6da3a5fb8753859a7458e56cc25ad289ec12e76/debian/prerm#L27

stdedos commented 3 years ago

Hello @raelgc 😀

I don't know if something is wrong with my installation, but /rubies/ are under /usr/share/rvm IIRC. Therefore rm -Rf /usr/share/rvm "means also" rm -Rf /usr/share/rvm/rubies. Or am I wrong to think about that?

I guess rvm implode also means rm -Rf /usr/share/rvm (in one way or another). I understand that any other structure would be a problem:

I would think "some way" of handling the above could be worth in order to not having to re-download everything (or to be able to explicitly inject).

In my case, I had a per-user installation, which appeared broken, so I tried to re-download rvm - to my surprise to find a "recommended installation for Ubuntu Focal" to be a mixed one. I thought I didn't need to clear the former to get the latter, but I ended up doing it anyway In the process, lost all my rubies (unexpected, but not such a big problem) and gemsets (expected, but I'd rather that the rvm snapshot save would somehow work).

stdedos commented 3 years ago

Before the these, we run rvm implode in prerm. Wondering if rvm implode is deleting rubies.

To directly answer your implicit question, I don't know 😕 It sounds possible, since the rvm implode is also used for the "plain" uninstallation.

raelgc commented 3 years ago

Yeap, you're right: this package install global rubies under /usr/share/rvm, but local gemsets.

I'm not sure how to handle the removal without call rvm implode (which will remove the rubies too).

stdedos commented 3 years ago

Maybe I should've thought about it deeper.

While "mishandled", it doesn't seem that this would solve the issue (given that rvm implode also means rm -Rf /usr/share/rvm somehow)

raelgc commented 3 years ago

Maybe we can, instead of rely on rvm implode, check which steps it runs, and create a custom removal, keeping the rubies.

stdedos commented 3 years ago

I am not sure if that would be your thing to do. Maybe it needs to be decided upstream.

@mpapis ^^?