Bug 100509 - First argument of a trigger script always matches second argument
Summary: First argument of a trigger script always matches second argument
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
(Show other bugs)
Version: 9
Hardware: All Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
Depends On:
Blocks: 107562
TreeView+ depends on / blocked
Reported: 2003-07-23 00:15 UTC by James Olin Oden
Modified: 2007-04-18 16:55 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-12-27 01:36:05 UTC
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-23 00:18 UTC, 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 04:00:00 UTC

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):

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.


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