[Rpm-maint] Patch: make file conflicts work correctly
pmatilai at laiskiainen.org
Wed Mar 20 07:59:14 UTC 2013
On 03/19/2013 09:00 PM, Michael Schroeder wrote:
> 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.
Hohum. The holes rpm has never cease to surprise...
Curiously enough, the entire Fedora package set doesn't seem to have a
single file conflict in it. Perhaps not too many people realize
conflicts on paths are even permitted by rpm :)
> 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.
It should be possible to further optimize + simplify this by (file)
lookups from rpmal while iterating over the conflicts already, then it
shouldn't even need the extra hash.
Anyway... applied, thanks for spotting the hole and for the patch!
I should try to add a test-case for this as well, sooner than later.
> (We could do the same trick for the requires in the erase package
Yup, and similar tricks with index iterator could be used for many of
the checks on installed packages in general. But hey, at least we now
have our first user of the index iterator inside rpm. Also goes to show
its a fairly clunky interface, might make sense to add an alternative
iter-next interface that's friendlier to strings, which is the case we
really care about.
- Panu -
> (What's somewhat missing is taking directory aliases into account,
> like done in fingerprinting.)
> Rpm-maint mailing list
> Rpm-maint at lists.rpm.org
More information about the Rpm-maint