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

"To uninstall "AM" just run the command am -R am" but what about if some package maintainer pack it for some linux distribution? So, it will be an illegal way to uninstall? #830

Closed
vitaly-zdanevich opened this issue Aug 9, 2024 · 26 comments

Comments

@vitaly-zdanevich
Copy link

For example in Ubuntu - user will need to use usual apt. So, what do you think about some conditional check?

I want to package it for Gentoo Linux - and normal way no uninstall packages here is # emerge --depclean <packagename>

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

Uhm... what about a rule?

I don't know how a gentoo package works, but I think that if you put a configuration file that prevents the command am -R am, everything should work as expected.

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

"AM" is a third party package manager, after all, so it is ment to be also easily uninstalled like this.

I think that a configuration file that has a rule to prevent AM removing itself if installed via "portage" would be enough for what you are looking at.

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

Same for other options, for example, am -s, if you don't want AM updating itself.

@vitaly-zdanevich
Copy link
Author

Ok, thanks, I will check the documentation about configuration file.

@Samueru-sama
Copy link
Contributor

I dont think a configuration file or even changes from our side are needed, I have an idea but Im on the phone, I will get back here later.

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

I also have an idea: uninstalling AM, or any other app from AM, depends on the "remove" script.

You can prevent the creation of /opt/am/remove

@vitaly-zdanevich
Copy link
Author

I think that a configuration file that has a rule to prevent AM removing itself if installed via "portage" would be enough for what you are looking at.

I do not know what rule - usually people create patches that remove code about remove/update.

@vitaly-zdanevich
Copy link
Author

You can prevent the creation of /opt/am/remove

Yep, but am -h should not have info about remove/update am.

@vitaly-zdanevich
Copy link
Author

...if installed by apt, portage, or another system package manager.

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

Tell me one thing, should a package of AM including also the modules?

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

if yes, you can apply patches to remove these references. All package maintainers do it.

@vitaly-zdanevich
Copy link
Author

Tell me one thing, should a package of AM including also the modules?

This modules?

Looks like yes, because, for example, help.am is here.

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

also, AM is GPL3, you can fork it and apply the needed patches

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

so you can remove, for example, the function that updates AM

AM/APP-MANAGER

Line 765 in 4d30b36

function _sync_amcli() {

@vitaly-zdanevich
Copy link
Author

if yes, you can apply patches to remove these references. All package maintainers do it.

Yes, looks like... Or maybe your CI/CD can build a special version for system package managers?

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

or maybe you can comment this line

AM/APP-MANAGER

Line 800 in 4d30b36

_sync_amcli

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

sed -i 's/	_sync_amcli/	#_sync_amcli/g' /opt/am/APP-MANAGER

with "TAB" spaces, don't forget

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

it is enough to add a post-installation script, also .deb packages have these

@vitaly-zdanevich
Copy link
Author

Or maybe add checks to code - that will check, for example, that some file is exists? If that file exists - instead of AM removing - print a message like "For uninstalling of AM - please use your system package manager".

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

@vitaly-zdanevich what AM has that prevents you to package it for gentoo?

I'll write the shell commands for you to patch it, for a post installation script, if you need it

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

I can create a dedicated directory in this repo with post installation scripts for gentoo or debian, if you want

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 9, 2024

but I don't know nothing about Gentoo, I've only tried one time to install a no more maintained italian distro, Sabayon

@ivan-hc ivan-hc mentioned this issue Aug 10, 2024
@Samueru-sama
Copy link
Contributor

Samueru-sama commented Aug 10, 2024

Is there something preventing the gentoo package of AM to replace the /opt/am/remove script for something like this:

echo "AM was installed by emerge, remove it using emerge"

That way AM can't remove itself, since the remove script is what removes it.

When you try to remove am with am -r am all it does it call its own /opt/am/remove script, which in this case won't actually remove anything and just echo a message.

@vitaly-zdanevich
Copy link
Author

Ok, I will write a patch for that - when will package for Gentoo.

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 28, 2024

I have a fix at #894

@ivan-hc
Copy link
Owner

ivan-hc commented Aug 29, 2024

@ivan-hc ivan-hc closed this as completed Aug 29, 2024
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

3 participants