What is the function of 'Requires(pre)' in spec file?
Jan Zelený
jzeleny at redhat.com
Thu Mar 24 15:08:49 UTC 2016
On 24. 3. 2016 at 10:31:09, Florian Festi wrote:
> On 03/24/2016 09:58 AM, Zhang Freeman wrote:
> > Hi List!
> >
> > I post to ask for the differenced between 'Requires' and 'Requires(pre)'
> > used in RPM spec file.
> >
> > As RPM wiki[1] tells, dependency defined via 'Requires(pre)' should be
> > fulfilled before installation and can be freely removed after
> > installation, and 'Requires' should be fulfilled after installation but
> > before execution.
> >
> > However, things won't stick to the script in real life. I find these two
> > work in the same way.
> >
> > Suppose I want to install package A, which depends on package B. RPM
> > stops the process and warns me the dependency. After B is installed,
> > installation of A turns to be succeed. Then I remove B, RPM erases both
> > A and B! No matter it is "Requires(pre)" or "Requires".
> >
> > Shouldn't A stay operational after I remove B if I use 'Requires(pre)' ?
>
> Well, it should... not sure if the implementation really fully does it
> that way. Also note, that there might be other dependencies for package
> B that may prevent the erasure. Also note that dependency solver like
> yum/dnf/zypper/... may have different idea of what packages to remove
> than rpm itself (which actually doesn't select packages to remove a t
> all, but just spits out error messages).
>
> Another difficult to spot difference between Requires: and
> Requires(pre): is package ordering during the installation. In case of
> circular dependencies rpm give precedence to Requires(pre): dependencies
> and rather breaks up normal Requires:
Looping in Honza Silhan. This topic has recently been opened in Fedora
developer community, as it seems a lot of people were packaging their stuff in
a wrong way. Details can be found here[1], perhaps it will answer some of your
questions.
[1]
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/NGPJMDUVEW65TQSD262G6OQF6P6LWWRM/
Thanks,
Jan
More information about the Rpm-list
mailing list