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

problems with trigger script args?



Folks,

I think there's a problem with the arguments to trigger scripts. From
/usr/share/doc/rpm-4.1/triggers:

        ...Recall that the $1 passed to regular scripts contains the 
number
        of instances of the package which will be installed when the
        operation has completed. $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. In this case, if any of the targets will remain after
        the uninstall, the trigger doesn't do anything (as it's probably
        being triggered by an upgrade).

I've included a test case. Untar the tarball, then enter "make", followed
by "./runtest". Annotated output follows.

I'm using rpm 4.1.

Any assistance in this matter would be appreciated. Thanks.

Regards,

Howard G Page
KG6MEW



+ set +e
+ PROCESSOR=i386
+ RID4A1=test4a-1.0-1
+ RID4A2=test4a-2.0-1
+ RID4B1=test4b-1.0-1
+ RID4C1=test4c-1.0-1
+ RID4D1=test4d-1.0-1
+ RID4E1=test4e-1.0-1
+ rpm -iv /usr/src/redhat/RPMS/i386/test4b-1.0-1.i386.rpm
Preparing packages for installation...
SCRIPT test4b pre install ARG1=1 ARG2=
test4b-1.0-1
SCRIPT test4b post install ARG1=1 ARG2=

+ rpm -iv /usr/src/redhat/RPMS/i386/test4c-1.0-1.i386.rpm
Preparing packages for installation...
SCRIPT test4c pre install ARG1=1 ARG2=
test4c-1.0-1
SCRIPT test4c post install ARG1=1 ARG2=

+ rpm -iv /usr/src/redhat/RPMS/i386/test4a-1.0-1.i386.rpm
Preparing packages for installation...
SCRIPT test4a-1 pre install ARG1=1 ARG2=
test4a-1.0-1
SCRIPT test4a-1 post install ARG1=1 ARG2=
SCRIPT test4c triggerin: trigger=test4a 1.0-1 ARG1=1 ARG2=1
SCRIPT test4a-1 triggerin: trigger=test4b ARG1=1 ARG2=1

+ rpm -Uv /usr/src/redhat/RPMS/i386/test4a-2.0-1.i386.rpm
Preparing packages for installation...
SCRIPT test4a-2 pre install ARG1=2 ARG2=
test4a-2.0-1
SCRIPT test4a-2 post install ARG1=2 ARG2=
SCRIPT test4c triggerin: trigger=test4a 2.0-1 ARG1=2 ARG2=2

        ARG1 should be 1 because there is only one copy of test4c 
        installed

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

        ARG1 should be 2 because there are two copies of test4a installed
        (test4a-1 and test4a-2)

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

        ARG1 should be 1 because there is only one copy of test4c 
        installed
        ARG2 should be 2 because there are two copies of test4a installed
        (test4a-1 and test4a-2)

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

        ARG1 should be 2 because there are two copies of test4a installed
        (test4a-1 and test4a-2)

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

+ rpm -ev test4a-2.0-1
SCRIPT test4c 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 2.0-1 ARG1=1 ARG2=0

+ rpm -ev test4b-1.0-1
SCRIPT test4b pre uninstall ARG1=0 ARG2=
SCRIPT test4b post uninstall ARG1=0 ARG2=

+ rpm -ev test4c-1.0-1
SCRIPT test4c pre uninstall ARG1=0 ARG2=
SCRIPT test4c post uninstall ARG1=0 ARG2=



Attachment: TEST4-1.tarz
Description: Binary data


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