2

I have a little requirement where I need to execute two triggers at the same time (on same package) but unfortunately RPM spec file executing only one trigger (whichever comes first) at a time.

Can anybody tell me how to execute the following two triggers..?

%triggerpostun -- odc#SHRTVER_NODOT#
%triggerpostun -- odc1010 <= 10.10.01.00

Here, SHRTVER_NODOT --> 1010

1st one will execute for all versions (it has to, Ex: 900,910,1000,1010 ...)
2nd one has to execute only when particular version found (Only 10.10.01.00)

I tried by switching these two triggers inside spec file and it is working fine (code wise!) but only one trigger at a time (whichever comes first).

Can anybody tell me how to make spec file to execute these two triggers.

Thanks for your help!!

EDIT::

Thank you, but this article refers different types of triggers and way of execution inside spec file. I have several other triggers in my spec file but unfortunately none of them makes this type of behavior.

%triggerin -- odc < 10.10.01.00
%triggerpostun -- odc

Like this also I have two more triggers but these are perfectly executing whenever the required version package found.

phanI KY
  • 111
  • 2
  • 10
  • A hint ... may be ... http://rpm.org/api/4.4.2.2/triggers.html ... – Knud Larsen May 30 '16 at 09:44
  • there seems to be a bug related to this. I tried to get a workaround extracting the version of the package being uninstalled; but since this is a "postun" trigger; we can't extract that version number anymore. There would be a way to have a very dirty workaround using a combination of "postun" and "un" triggers and storing the version to a temporary file... – Chris Maes May 30 '16 at 09:53
  • Yes, for workaround I have combined both scripts in same trigger but unfortunately my new script (which should execute only one version) executing for every version along with other script. I didn't get how can I solve this..? So, I created two triggers but here only one trigger executing at a time.. – phanI KY May 30 '16 at 10:01

1 Answers1

0

Some older versions of RPM executed only a single trigger per package for each type. The rpm-4.4.2.2 (in RHEL5/CentOS5?) is likely in this category

Jeff Johnson
  • 2,310
  • 13
  • 23