Author Topic: How to differ 'remove' and 'remove completely' using Synaptic in rpm building?  (Read 1873 times)

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Hi all,

how is it possible to differ between the user asking for a complete removal (including data files) in Synaptic and a normal 'remove package'?

I would like to improve some uninstall features, like dropping a mysql database if the user selects 'complete removal', and are just asking because the choice is available in Synaptic.

The uninstall feature will then be much improved IMO,

cheers,
MBantz

Offline Kaboosh

  • Jr. Member
  • **
  • Posts: 29
I have exactly the same question.  Does nobody in PCLinuxOS land know the answer to this?  Surely some of the packagers must since they build packages which implement this...or is it so elementary that it's not worth responding to?

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3991
The answer is very simple; that's a deb-only facility which makes no difference with rpms.

Synaptic was originally designed for debs, and doesn't know pclos will never use them, so it provides the option even though it has no meaning here.
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline Kaboosh

  • Jr. Member
  • **
  • Posts: 29
So now the harder question:  when to decide whether to drop a user your package has created?  Is the PCLinuxOS norm just to leave it once it's there or to always fully clean up?

Also - does %postun run when a reinstall/upgrade is performed?  Because dropping a user in these cases might be bad news indeed   :-\

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
 ??? %postun occurs just as it says. Post uninstall.

Offline Kaboosh

  • Jr. Member
  • **
  • Posts: 29
So a reinstall is not just an uninstall followed by an install?  And an upgrade is not just an uninstall of the old version followed by an install of the new version?  Funny...that's how I always thought it worked...

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
So a reinstall is not just an uninstall followed by an install?  And an upgrade is not just an uninstall of the old version followed by an install of the new version?  Funny...that's how I always thought it worked...

Reinstall: Install the app a second time. This does not start with an uninstall. It just installs the app.

Upgrade: Install an "upgrade," or newer version of an app. This overwrites the old with the new. Uninstall occurs only if it is required for a clean install of the new to occur.

Uninstall: Removal of the app from the system. If any extra action is needed, it should be provided in %postun.

Clear?

Offline Kaboosh

  • Jr. Member
  • **
  • Posts: 29
Almost clear.  How does RPM decide that an uninstall is "required" when upgrading?

uncleV

  • Guest
I have exactly the same question.  Does nobody in PCLinuxOS land know the answer to this?  Surely some of the packagers must since they build packages which implement this...or is it so elementary that it's not worth responding to?

If I understand correctly the question the answer is simple:


"Including configuration files" should mean your own configurations that are usually saved in your Home.
If you remove and after that install again you should end with your own configs in action.
If you remove completely and after that install you should end with the default configs.
« Last Edit: March 26, 2011, 01:15:07 AM by uncleV »

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Almost clear.  How does RPM decide that an uninstall is "required" when upgrading?

It will be included in the spec file.

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3991
UncleV,

The configuration files installed or removed by rpm are not usually installed in your ~ directory. Rpm does not delete files in there. (Re-phrase - an rpm which interfered with ~ would cause large numbers of complaints -  an rpm can do anything root can do.)

The configuration files referred to are those in the /etc/ tree (or wherever the packager/programmer has chosen to put them). However, there is no option in rpm to leave or remove these files. The packager will take that decision and the user can't change it. Dpkg does have such an option, and as I wrote above, apt-get and Synaptic were originally written for .deb packages.
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

uncleV

  • Guest
Thank you, kjpetrie, for clarification. :)