Re: preun/postun argument when multiple instances

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

 



i decided to test this for you with a really simple pointless rpm called
test.

the pointless rpms i built are:
test-2-1.rhel4.i386.rpm
test-1-1.rhel4.i386.rpm

each have the following for %pre, %post, %preun, %postun

%pre
echo "pre is $1"
echo "package is 1"

%post
echo "post is $1"
echo "package is 1"

%preun
echo "preun is $1"
echo "package is 1"

%postun
echo "postun is $1"
echo "package is 1"

(where package version 2 says 'package is 2')

results:

[root@localhost i386]# rpm -i test-1-1.rhel4.i386.rpm
pre is 1
package is 1
post is 1
package is 1
[root@localhost i386]# rpm -i test-2-1.rhel4.i386.rpm
pre is 2
package is 2
post is 2
package is 2
[root@localhost i386]# rpm -q test
test-1-1.rhel4
test-2-1.rhel4
[root@localhost i386]# rpm -e test-1-1.rhel4 test-2-1.rhel4
preun is 1
package is 2
postun is 1
package is 2
preun is 0
package is 1
postun is 0
package is 1
[root@localhost i386]#


On Wed, 2007-06-06 at 16:29 +0200, Sebastien BLAISOT wrote:
> Hi there,
> 
> Just a question :
> 
> If I have multiple instances (with, say, different versions) of a 
> package installed and uninstall them with a single rpm command, what 
> value will the preun and postun scripts receive as an argument ?
> 
> for example, say I installed foobar-1.0-1 and foobar-1.1-1 (whith no 
> conflict as foobar-1.0 installs in a different directory than 
> foobar-1.1) and issue the following command :
> rpm -e foobar-1.0-1 foobar-1.1-1
> 
> which argument will receive the preun and postun scripts of each package.
> 
> will foobar-1.0-1 get 1 and foobar-1.1-1 get 0 or will they both receive 0 ?
> 
> thanks in advance,
> 
-- 
Hiren Patel

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This e-mail and its contents are subject to the Telkom SA Limited
e-mail legal notice available at 
http://www.telkom.co.za/TelkomEMailLegalNotice.PDF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux