RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Obsoletes is buggy

From: devzero2000 <devzero2000@rpm5.org>
Date: Wed 15 Oct 2008 - 11:26:33 CEST
Message-ID: <b086760e0810150226h252c1abgf8def6a265819ea1@mail.gmail.com>
On 10/14/08, Jeff Johnson <n3npq.jbj@gmail.com> wrote:
>
> Consider these packages
>        Name: A
> and
>        Name: B
>        Obsoletes: A
>
> There's an implicit assumption that B is installed after A.


In the second SPEC probably you want renaming the first package so it became

Name: B
Obsoletes: A <= EVR of A
Provides :  A =  EVR of A

The version is for introduce a point of misure in the rpmdb dependency
graph, that, as you know, is a good thing to have.

So this sequence Does The Right Thing
>        rpm -Uvh A*.rpm
>        rpm -Uvh B*.rpm
> while if the {A,B} install order is reversed, or both A and B are installed
> together,
> then rpm Does The Wrong Thing.


Depends what is the "Wrong Things".

In your example there is the assuntion that B is what i want installed
anyway. Now, if B provide a file that conflict with A, in general the common
case, there is no problem. I have ever installed B it is not possible
installing A and if had installed A first, then installing B remove A.

[root@BUILDER ~]# rpm -Uvh /home/machbuild/rpmbuild/RPMS/A-1.0-1.noarch.rpm
Preparing...                ###########################################
[100%]
   1:A                      ###########################################
[100%]
[root@BUILDER ~]# rpm -Uvh /home/machbuild/rpmbuild/RPMS/B-1.0-1.noarch.rpm
Preparing...                ###########################################
[100%]
   1:B                      ###########################################
[100%]
[root@BUILDER ~]# rpm -qi A
package A is not installed
[root@BUILDER ~]# rpm -e B
[root@BUILDER ~]# rpm -Uvh /home/machbuild/rpmbuild/RPMS/B-1.0-1.noarch.rpm
Preparing...                ###########################################
[100%]
   1:B                      ###########################################
[100%]
[root@BUILDER ~]# rpm -Uvh /home/machbuild/rpmbuild/RPMS/A-1.0-1.noarch.rpm
Preparing...                ###########################################
[100%]
        file /etc/A from install of A-1.0-1 conflicts with file from package
B-1.0-1


But YES in the general case, for example rsyslog replacing ALWAYS sysklogd,
the rpm behaviour is
not what aspected (in my POV). But FWIW there are other POV on this topic,
for example

http://wiki.mandriva.com/en/RPM_Dependency_Optimization

(ASIDE) off topic : I think it is ironic, or simply wrong, IMHO that someone
insist to write something like this in 2008
.......begin quoted

Part of the difference is caused by slower access to the db-format package
base in RPM (Dpkg uses plaintext)

......end quoted

(sigh)




There are (at least) two pieces to "fix":
>
> 1) apply Obsoletes: dependencies against the current transaction elements,
> eliminating any elements that match the Obsoletes: with a warning.
>
> 2) make Obsoletes: persistent in an rpmdb, generating an Obsoletename
> table,
> perhaps adding a --whatobsoletes query option. Hmm --whatconflicts is
> likely
> needed too, not hard, just tedious. time to think a bit ...
>
> Bugs R us today, todo++.



I vote 2).

Regards
Received on Wed Oct 15 11:26:35 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.