[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

trigger script arguments



Folks,

Another issue!

Don't understand the arguments to the
trigger scripts. The first arg is: (from:
http://www.redhat.com/docs/books/max-rpm/max-rpm-html/s1-rpm-inside-scripts.html)

	The sole argument to these scripts, is a number representing the
	number of instances of the package currently installed on the
	system, after the current package has been installed or erased.

and the second argument: (from:
file:///usr/share/doc/rpm-devel-4.1/apidocs/html/triggers.html)

	$1 for triggers is exactly the same -- it is the number of
	instances of the source (or triggered) package which will remain
      ->when the trigger has completed. Similarly, $2 is the number of
      ->instances of the target package which will remain.


>From nmy test case in the previous message:


    SCRIPT INSTALL test4b-1
    SCRIPT test4b pre install ARG1=1 ARG2=
    SCRIPT test4b post install ARG1=1 ARG2=
    
    SCRIPT INSTALL test4c-1
    SCRIPT test4c pre install ARG1=1 ARG2=
    SCRIPT test4c post install ARG1=1 ARG2=
    
    SCRIPT INSTALL test4d-1
    SCRIPT test4d pre install ARG1=1 ARG2=
    SCRIPT test4d post install ARG1=1 ARG2=
    
    SCRIPT INSTALL test4e-1
    SCRIPT test4e pre install ARG1=1 ARG2=
    SCRIPT test4e post install ARG1=1 ARG2=
    
    SCRIPT INSTALL test4a-1
    SCRIPT test4a-1 pre install ARG1=1 ARG2=
    SCRIPT test4a-1 post install ARG1=1 ARG2=
    SCRIPT test4c triggerin: trigger=test4a 1.0-1 ARG1=1 ARG2=1
    SCRIPT test4d triggerin: trigger=test4a 1.0-1 ARG1=1 ARG2=1
    SCRIPT test4e triggerin: trigger=test4a 2.0-1 ARG1=1 ARG2=1
    SCRIPT test4a-1 triggerin: trigger=test4b ARG1=1 ARG2=1
    
    SCRIPT UPGRADE test4a-2
    SCRIPT test4a-2 pre install ARG1=2 ARG2=
    SCRIPT test4a-2 post install ARG1=2 ARG2=

source=test4c - # of instances doesn't change hence ARG1 should = 1. ERROR!
trigger=test4a
(actually, this should have NOT been triggered -- wrong version)

    SCRIPT test4c triggerin: trigger=test4a 1.0-1 ARG1=2 ARG2=2

source=test4d - # of instances doesn't change hence ARG1 should = 1. ERROR!
trigger=test4a
(actually, this should have NOT been triggered -- wrong version)

    SCRIPT test4d triggerin: trigger=test4a 1.0-1 ARG1=2 ARG2=2

source=test4e - # of instances doesn't change hence ARG1 should = 1. ERROR!
trigger=test4a

    SCRIPT test4e triggerin: trigger=test4a 2.0-1 ARG1=2 ARG2=2

source=test4a - # of instances will be 2 hence ARG1 should = 2. ERROR!
trigger=test4b

    SCRIPT test4a-2 triggerin: trigger=test4b ARG1=1 ARG2=1

source=test4c - # of instances doesn't change hence ARG1 should = 1. ERROR!
trigger=test4a

    SCRIPT test4c triggerun: trigger=test4a 1.0-1 ARG1=2 ARG2=1

source=test4d - # of instances doesn't change hence ARG1 should = 1. ERROR!
trigger=test4a

    SCRIPT test4d triggerun: trigger=test4a 1.0-1 ARG1=2 ARG2=1

source=test4e - # of instances doesn't change hence ARG1 should = 1. ERROR!
trigger=test4a
(actually, this should have NOT been triggered -- wrong version)

    SCRIPT test4e triggerun: trigger=test4a 2.0-1 ARG1=2 ARG2=1

source=test4a OK
trigger=test4b OK

    SCRIPT test4a-1 triggerun: trigger=test4b ARG1=0 ARG2=1

    SCRIPT test4a-1 pre uninstall ARG1=1 ARG2=
    SCRIPT test4a-1 post uninstall ARG1=1 ARG2=

source=test4c - # of instances doesn't change hence ARG1 should = 1. ERROR!
trigger=test4a

    SCRIPT test4c triggerpostun: trigger=test4a 1.0-1 ARG1=2 ARG2=1

source=test4d - # of instances doesn't change hence ARG1 should = 1. ERROR!
trigger=test4a

    SCRIPT test4d triggerpostun: trigger=test4a 1.0-1 ARG1=2 ARG2=1

source=test4e - # of instances doesn't change hence ARG1 should = 1. ERROR!
trigger=test4a
(actually, this should have NOT been triggered -- wrong version)

    SCRIPT test4e triggerpostun: trigger=test4a 2.0-1 ARG1=2 ARG2=1
    
    SCRIPT ERASE test4a-2
    SCRIPT test4c triggerun: trigger=test4a 1.0-1 ARG1=1 ARG2=0
    SCRIPT test4d triggerun: trigger=test4a 1.0-1 ARG1=1 ARG2=0
    SCRIPT test4e triggerun: trigger=test4a 2.0-1 ARG1=1 ARG2=0
    SCRIPT test4a-2 triggerun: trigger=test4b ARG1=0 ARG2=1
    SCRIPT test4a-2 pre uninstall ARG1=0 ARG2=
    SCRIPT test4a-2 post uninstall ARG1=0 ARG2=
    SCRIPT test4c triggerpostun: trigger=test4a 1.0-1 ARG1=1 ARG2=0
    SCRIPT test4d triggerpostun: trigger=test4a 1.0-1 ARG1=1 ARG2=0
    SCRIPT test4e triggerpostun: trigger=test4a 2.0-1 ARG1=1 ARG2=0
    
    SCRIPT ERASE test4b-1
    SCRIPT test4b pre uninstall ARG1=0 ARG2=
    SCRIPT test4b post uninstall ARG1=0 ARG2=
    
    SCRIPT ERASE test4c-1
    SCRIPT test4c pre uninstall ARG1=0 ARG2=
    SCRIPT test4c post uninstall ARG1=0 ARG2=
    
    SCRIPT ERASE test4d-1
    SCRIPT test4d pre uninstall ARG1=0 ARG2=
    SCRIPT test4d post uninstall ARG1=0 ARG2=
    
    SCRIPT ERASE test4e-1
    SCRIPT test4e pre uninstall ARG1=0 ARG2=
    SCRIPT test4e post uninstall ARG1=0 ARG2=

Attached are the test cases.
	
Regards,

Howard G Page





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []