RPM dependency rationale (and kernel packages)?

Jeff Johnson jbj at redhat.com
Tue Aug 19 17:23:11 UTC 2003


On Tue, Aug 19, 2003 at 07:04:21PM +0200, Jos Vos wrote:
> Hi,
> 
> Short intro:
> 
> Every package provides itself implicitly, as if the line
> "Provides: foo = 5.0-2" was in the spec file.  This means that any
> dependency on "foo", "foo = 5.0", or "foo = 5.0-2" is satisfied
> (as well as relational dependencies, like "foo >= 5.0" etc.).
> This is all the basic RPM dependency behaviour and pretty
> straightforward.
> 
> It now seems that rpm also has the following behaviour:
> 
> If you put an explicit "Provides" line in the spec file *omitting*
> the release, say "Provides: foo = 5.0", then *any* dependency on
> version 5.0 of foo, whatever release is required (!), is satisfied.
> So, a package having "Require: foo = 5.0-6" happily coexists with
> the foo-5.0-2 package.  I don't understand this.  Or it's a bug,
> or there is some rationale for this that I don't know of (yet).
> 
> It also is the case that every kernel package provides
> "kernel = %{version}" explicitly.  AFAIK this is mainly done to let
> kernel-smp, kernel-bigmem, etc. all "provide" the basic kernel too
> (but Arjan can tell much more about this, see also our disussion
> on https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=102639
> earlier today).
> 
> In my case, I wanted to let a pseudo-package require specifically
> "kernel = 2.4.20-18.9", to pull that kernel package in with APT
> (more details on request) and I then detected that "kernel-2.4.20-8"
> was good enough for rpm (and APT) to satisfy "kernel = 2.4.20-18.9".
> 
> So, now the main issues:
> 
> -  Is the rpm bahaviour a bug or a feauture (if a feature, why)?
> 

Feature, or at least necessity for legacy compatibility.

Before rpm-3.0.2, only Requires: and Conflicts: permitted versions.

In order to implement versioning for PreReq:, Obsoletes: and Provides:,
some way of not breaking backward<->forward compatibility had to be devised.

The scheme is that a missing value (as found in legacy packages)
provides all possible or requires any possible match.

For example,
	Requires: kernel = 2.4.20-18.9
is satisfied by the
	Provides: kernel = 2.4.20
i.e. the provides without an explicit Release: matches any Requires:.

> -  Arjan has good reasons for the current kernel provides lines, 
>    but I'm mainly objecting against the rpm bahaviour, so could
>    a different behaviour coexist with Arjans kernel packaging goals?
> 

And there are even better reasons for not changing rpm's behavior.

Add a file requires on a file in the kernel package that has both the
Version: and Release: appended as suffix, almost every file in the
package as both V-R appended.

> Note that the bug report Panu submitted (see above) mainly resulted
> in a kernel packaging discussion, although the core question lays
> at the rpm level.
> 

73 de Jeff

-- 
Jeff Johnson	ARS N3NPQ
jbj at redhat.com (jbj at jbj.org)
Chapel Hill, NC





More information about the devel mailing list