[Rpm-maint] Patch: make file conflicts work correctly

Michael Schroeder mls at suse.de
Tue Mar 19 19:00:36 UTC 2013


Hi,

I noticed that if I install a package, rpm checks that a conflict
in the new package is not satisfied by an installed file, but
it ignores when a conflict of an installed package is satisfied
by a file of the new package.

To clarify:

Package A: Contains file "/foo"
Package B: Has "Conflicts: /foo"

rpm -U A.rpm, then rpm -U B.rpm results in:
error: Failed dependencies:
        /foo conflicts with B-1-1.i586

rpm -U B.rpm, then rpm -U A.rpm will work.

Attached is a patch that fixes this hole, it uses an IndexIterator
over RPMTAG_CONFLICTNAME to create a hash with all of the possible
file conflicts to speed things up.

(We could do the same trick for the requires in the erase package
case.)

(What's somewhat missing is taking directory aliases into account,
like done in fingerprinting.)


Cheers,
  Michael.

-- 
Michael Schroeder                                   mls at suse.de
SUSE LINUX Products GmbH,  GF Jeff Hawn, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: depends.diff
Type: text/x-patch
Size: 2227 bytes
Desc: not available
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20130319/13ca805d/attachment.bin>


More information about the Rpm-maint mailing list