Bug 100509

Summary: First argument of a trigger script always matches second argument
Product: [Retired] Red Hat Linux Reporter: James Olin Oden <james.oden>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED ERRATA QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: bugzilla, chris.ricker, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-12-27 01:36:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 107562    
Attachments:
Description Flags
Patch to use name of rpm causing containing trigger to determine number instances for arg1 none

Description James Olin Oden 2003-07-23 00:15:42 UTC
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):
4.2

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-23 00:18:21 UTC
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 13:06:54 UTC
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-27 01:36:05 UTC
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 04:27:17 UTC
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.

http://rhn.redhat.com/errata/RHBA-2004-098.html