Closed vitaly-zdanevich closed 2 weeks ago
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.
"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.
Same for other options, for example, am -s
, if you don't want AM updating itself.
Ok, thanks, I will check the documentation about configuration file.
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.
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
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.
You can prevent the creation of /opt/am/remove
Yep, but am -h
should not have info about remove/update am.
...if installed by apt, portage, or another system package manager.
Tell me one thing, should a package of AM including also the modules?
if yes, you can apply patches to remove these references. All package maintainers do it.
Tell me one thing, should a package of AM including also the modules?
Looks like yes, because, for example, help.am
is here.
also, AM is GPL3, you can fork it and apply the needed patches
so you can remove, for example, the function that updates AM https://github.com/ivan-hc/AM/blob/4d30b36ff2a17adde3f8f593f1236b195ff1a3ab/APP-MANAGER#L765
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?
or maybe you can comment this line https://github.com/ivan-hc/AM/blob/4d30b36ff2a17adde3f8f593f1236b195ff1a3ab/APP-MANAGER#L800
sed -i 's/ _sync_amcli/ #_sync_amcli/g' /opt/am/APP-MANAGER
with "TAB" spaces, don't forget
it is enough to add a post-installation script, also .deb packages have these
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".
@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
I can create a dedicated directory in this repo with post installation scripts for gentoo or debian, if you want
but I don't know nothing about Gentoo, I've only tried one time to install a no more maintained italian distro, Sabayon
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.
Ok, I will write a patch for that - when will package for Gentoo.
I have a fix at https://github.com/ivan-hc/AM/pull/894
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>