RPM Community Forums

Mailing List Message of <rpm-users>

Re: 'Obsolotes' and 'Requires'

From: Anshuman Kanetkar <akanetkar@acm.org>
Date: Mon 01 Jun 2009 - 23:37:10 CEST
Message-ID: <5e7a8c890906011437g165a15ft5597e9560d1da2c1@mail.gmail.com>
    Thanks for asking :).

Here is what I want to accomplish:

- Consider a system, with the state of its  package database and
installed packages at some state S0.

- Now, there is a sequence of available upgrades U1 and U2  already
published for this system, that take it to
states S1 and S2 respectively.

- Each upgrade is a set of one or more RPMs.

- Each upgrade can perform only one state transition - i.e. the shortest one.
e.g. U1 takes the system from S0 to S1
       U2 from S1 to S2, and so on.

- Now, can the package creator construct an upgrade U3, such that it
can upgrade a system from state S0 to a state S3, by forcing
transitions from S0 through S2 using package-level dependencies? (Just
so that Yum can sequence the updates, rather than the package creator
having to write her upgrade packages to explicitly check for

As part of this, some scenarios would be:

- If a  package  requires a previous version of the same package as a
prerequisite, can this be expressed in the RPM spec? (Does this work?
I am guessing it does.)

- Now some packages from U3 could only depend on side-effects of
packages in U1/U2. As long as erasing those packages does not undo
those side-effects, I would want to preserve the side-effects, but
erase the packages.
I figured one way to achieve this would be obsolescence. So, can a
package 'a.rpm' require 'b.rpm', but also obsolete it? Is the
'requires' relation only a pre-installation check (i.e. it doesn't
matter if b is removed later during the transaction), or does it imply
a & b *must* co-exist? What would be the sequence of actions in this

And of course, is there a different, better way to achieve the same result?


On Mon, Jun 1, 2009 at 12:53 PM, Jeff Johnson <n3npq@mac.com> wrote:
> On Jun 1, 2009, at 3:28 PM, Anshuman Kanetkar wrote:
>> Hi,
>>  Can the 'Obsoletes' and 'Requires' relations be combined together,
>> directed towards the same target from an RPM?
>> e.g.
>> a.rpm -- Obsoletes --> b.rpm
>> a.rpm -- Requires --> b.rpm
>> What I want to express is that package 'a' needs 'b' as a prerequisite
>> ('a'  cannot be installed unless 'b' is installed first), but the
>> installation of 'a' should then obsolete 'b'.
>> Does RPM allow such semantics?
> Requires: is an assertion statement and ordering hint, Obsoletes: is a
> generalization
> of package erasing, which are quite different things.
> And so the combination is "allowed".
> But its unlikely that specifying a Requires: and Obsoletes: does what you
> desire.
> Let's back up a bit ...
> What are you trying to accomplish in packaging?
> At a general level, not with specific questions about what Requires: and
> Obsoletes:
> can or will do.
> There's likely a solution even if not specifically what you are asking re
> Requires: and Obsoletes:.
> 73 de Jeff
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> User Communication List                             rpm-users@rpm5.org
Received on Mon Jun 1 23:39:49 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.