RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Problem about upgrade multiple rpm package.: possible bug found

From: devzero2000 <devzero2000@rpm5.org>
Date: Wed 10 Dec 2008 - 18:25:34 CET
Message-ID: <b086760e0812100925y361e3abfl1c762a6e0001a32b@mail.gmail.com>
Probably you have found a bug.

See below:

rpm -Uvh A-1.0-1.noarch.rpm B-1.0-1.noarch.rpm
Preparing...                ###########################################
[100%]
   1:A                      ########################################### [
50%]
   2:B                      ###########################################
[100%]

Now B-2.0-1 depends on A = 2.0 but

rpm -Uvh A-2.0-1.noarch.rpm B-2.0-1.noarch.rpm

Preparing...                ###########################################
[100%]
error: %pre(A-2.0-1.noarch) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping A-2.0-1
   1:B                      ########################################### [
50%]

[1]+  Exit 2                  rpm -Uvh A-2.0-1.noarch.rpm B-2.0-1.noarch.rpm

rpm -qR B
/bin/sh
/bin/sh
/bin/sh
/bin/sh
/bin/sh
A = 2.0
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
[root@testupgradefail]# rpm -q --qf '%{VERSION}\n' A
1.0

The  possible workround (an hackery for that matter : adding a %pre to B on
the right version on A) is worse:

rpm -Uvh A-2.0-1.noarch.rpm B-2.0-1_workround.noarch.rpm
Preparing...                ###########################################
[100%]
error: %pre(A-2.0-1.noarch) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping A-2.0-1
error: %pre(B-2.0-1_workround.noarch) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping B-2.0-1_workround

But

rpm -qi A
package A is not installed

YEP!

Sorry, i don't know how to help you. My workround was - my - last resort.

For who is interested, all the reproducer are here :

http://www.esnips.com/web/devzero2000-rpm


Regards




On Wed, Dec 10, 2008 at 4:25 PM, qiuhd <qiuhd@yahoo.com.cn> wrote:

> The new B does depend on new A.
> You know, I am testing the package, there is a status checking in the %pre
> scriptlet, sometime it fail.
> My problem is why the separate upgrade works fine with a clean exit, leave
> the old installed one untouched, but one line command remove the old one.
>
> rpm -Uvh A_2.0.rpm
> rpm -Uvh B_2.0.rpm
>
> clean exit
>
> ====================
>
> rpm -Uvh A_2.0.rpm B_2.0.rpm
>
> exit and remove the old one, we don't want this.
>
> Thanks.
>
>
>
> --- On *Wed, 12/10/08, devzero2000 <devzero2000@rpm5.org>* wrote:
>
> From: devzero2000 <devzero2000@rpm5.org>
> Subject: Re: Problem about upgrade multiple rpm package.
> To: qiuhd@yahoo.com.cn, "General discussion about the RPM package manager"
> <rpm-list@lists.rpm.org>
> Date: Wednesday, December 10, 2008, 9:28 PM
>
> On Wed, Dec 10, 2008 at 9:13 AM, qiuhd <qiuhd@yahoo.com.cn> wrote:
> > Hi, Guys
> > Please help me about this upgrade problem.
> > I built two packages, A and B, B has dependency on A. I have a old
> version
> > of A ( A_1.0.rpm) installed on my linux system, now I want to upgrade to
> the
> > new version by execute
> > rpm -Uvh A_2.0.rpm B_2.0.rpm
> > If the %pre scriptlet failed because of some reason, I think the upgrade
> > should abort and leave the old installed on untouched.
>
> The new B depends on the new A ? From your description i think no. Why
> should be the upgrade abort all ?
> If you use a C rpm - unrelated a A but with %pre failing - what do you
> think should be happen on : rpm -Uvh C_1_0.rpm B_2_0.rpm ?
> B should be failing to upgrade ?
>
> Regards
>
>
>
Received on Wed Dec 10 18:51:00 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.