ubuntu_rvm icon indicating copy to clipboard operation
ubuntu_rvm copied to clipboard

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

Open stdedos opened this issue 4 years ago • 7 comments

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.

stdedos avatar Apr 12 '21 10:04 stdedos

Hi @stdedos and thanks for opening this issue.

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

  • /usr/share/rvm
  • /etc/rvmrc
  • /etc/profile.d/rvm.sh

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

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

raelgc avatar Apr 12 '21 13:04 raelgc

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:

  • /usr/share/rvm, /usr/share/rvm-static-files
  • rm -Rf /usr/share/rvm/this /usr/share/rvm/that /usr/share/rvm/the_other_thing /usr/share/rvm/and_the_other_other_thing

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 avatar Apr 12 '21 13:04 stdedos

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.

stdedos avatar Apr 12 '21 13:04 stdedos

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).

raelgc avatar Apr 12 '21 13:04 raelgc

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)

stdedos avatar Apr 12 '21 13:04 stdedos

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

raelgc avatar Apr 12 '21 14:04 raelgc

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

@mpapis ^^?

stdedos avatar Apr 13 '21 08:04 stdedos