[Rpm-maint] Problems with %Requires(preun):

Scott Bambrough scottb at xandros.com
Tue Dec 11 19:01:02 UTC 2007

Pixel wrote:
> afaik rpm does not order package removal :-(
Interesting.   The section on context marked dependencies in the 
snapshot version of Maximum RPM suggests it should.  See 

Context Marked Dependencies

Recent versions of RPM support context marked dependencies. This is a 
special type of a dependency that applies only in a specified context. 
Using this feature, one can specify dependencies for pre- and 
post(un)install scriptlets, ie. the context of a dependency is the 
execution time of the specified scriptlet.

The syntax for specifying these dependencies is:

Requires(X): foo
Here, X can be one of pre, post, preun, or postun, which tells RPM that 
the package depends on package foo for running the corresponding %pre, 
%post, %preun, or %postun script.

In practice, RPM enforces the above dependencies until the specified 
script has been run, not at that time. In other words, it will allow 
erasing a dependency that was marked for eg. the %post script for an 
already installed package, but will not allow erasing one that is 
required for a %postun script for such a package. This is to reduce 
confusion; it would be somewhat odd if RPM told one to install a package 
in order to get another one erased.

Is their a disconnect between the documentation and the code, or how are 
context marked dependencies supposed to work (if at all).


More information about the Rpm-maint mailing list