Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 100509 - First argument of a trigger script always matches second argument
First argument of a trigger script always matches second argument
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
Depends On:
Blocks: 107562
  Show dependency treegraph
Reported: 2003-07-22 20:15 EDT by James Olin Oden
Modified: 2007-04-18 12:55 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-12-26 20:36:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to use name of rpm causing containing trigger to determine number instances for arg1 (1.05 KB, patch)
2003-07-22 20:18 EDT, James Olin Oden
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2004:098 normal SHIPPED_LIVE Updated rpm package fixes several bugs 2004-05-12 00:00:00 EDT

  None (edit)
Description James Olin Oden 2003-07-22 20:15:42 EDT
Description of problem:
Given two rpms a and b where b has an install trigger on a.  Whenever
the trigger is ran, the first argument passed to the trigger will
always equal the second argument (the first being the number of
instances of the trigger containing rpm and the second being the 
the number of instances of the triggering rpm).

Version-Release number of selected component (if applicable):

How reproducible:
Every time.

Steps to Reproduce:
1.  Install rpm a-1-1 and b-1-1 on the system in one transaction.
2.  Upgrade to a-1-2 or b-1-2.
Actual results:
If you upgrade to a-1-2 then the args will be (2, 2) respectively.
If you had upgraded to b-1-2 the args will be (1, 1).

Expected results:
For an upgrade a-1-2 the args should have been (1, 2),
and for b-1-2 they should have been (2, 1).

Additional info:
Jeff, your basically using the name you got from the dependency list
to determine the count of instances of the rpm containing the trigger.
Just need to take the triggerH and get the name from that to get this
info.  I have a patch for this.
Comment 1 James Olin Oden 2003-07-22 20:18:21 EDT
Created attachment 93068 [details]
Patch to use name of rpm causing containing trigger to determine number instances for arg1
Comment 2 Toralf 2003-10-22 09:06:54 EDT
I'm having a different problem that I think may be related:

If b (in the above example) has an an *uninstall* trigger, it is executed with
$1 = 0 on upgrade to b-1-2. $1 should have been 1, I think, since b is still
installed after the upgrade.
Comment 3 Jeff Johnson 2003-12-26 20:36:05 EST
Added (finally) in CVS, should be in rpm-4.2.2-0.8 and later.

Thanks for the patch.
Comment 5 John Flanagan 2004-05-12 00:27:17 EDT
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.