Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stdedos opened this issue Apr 12, 2021 · 7 comments
Open

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

stdedos opened this issue Apr 12, 2021 · 7 comments

Comments

@stdedos
Copy link

stdedos commented Apr 12, 2021

ubuntu_rvm/debian/postrm

Lines 25 to 27 in f6da3a5

remove|purge|disappear)
# Double check complete folder removal
rm -Rf /usr/share/rvm

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
Copy link
Contributor

raelgc commented Apr 12, 2021

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.

bash --noprofile -c "source $file && rvm --force implode"

@stdedos
Copy link
Author

stdedos commented Apr 12, 2021

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
Copy link
Author

stdedos commented Apr 12, 2021

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
Copy link
Contributor

raelgc commented Apr 12, 2021

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
Copy link
Author

stdedos commented Apr 12, 2021

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
Copy link
Contributor

raelgc commented Apr 12, 2021

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

@stdedos
Copy link
Author

stdedos commented Apr 13, 2021

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

@mpapis ^^?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants