Stephen
Stephen

Reputation: 621

rpm spec file magic: automatically updating package X whenever package Y is updated

In short, I have two packages: X and Y. X depends on Y. I am going to create an RPM--writing spec file, etc--for X while Y rpm has been already around.

The problem is that while X can and should work with any version of Y, X must be removed and re-installed whenever Y is updated. What kind of rpm magic can solve this problem?

The reason is as follows. X is installed and uninstalled only by a command that Y provides. The command itself does not change. However, what the command of Y's does may differ from version to version.

Moreover, the command does not just adding files to the file system. It seems to update a binary DB file that belongs to Y, and who knows what is in the DB file.

To me, it really makes sense that X is uninstalled and re-installed whenever I have a new Y. Actually, X has been installed manually so far.

Upvotes: 0

Views: 255

Answers (1)

Chris Maes
Chris Maes

Reputation: 37812

I don't think you can cause an uninstall and reinstall of an rpm by another. However if I understand well; you want some kind of destroy and recreate operation to run upon each update of Y?

You can manage this using triggers:

in X.spec you can put:

%triggerin -- Y
# this script runs each time Y is installed or updated
# and will also run upon installation of X if Y was already installed before
# do your DB manipulation here

Upvotes: 1

Related Questions