[CentOS] [YUM] - Issue on package removal order on CentOS 5

Sat Nov 5 14:29:27 UTC 2011
Ned Slider <ned at unixmail.co.uk>

On 05/11/11 13:22, Olivier BONHOMME wrote:
> Hello,
>
> I post here because I have an embarassing issue considering the yum
> version provided with CentOS 5.
>
> I am trying to package an application for CentOS. So I wrote my own
> specfile which is composed of declaration of various packages (main
> application and plugins for this applications).
>
> In that the configuration, the plugins RPM depends on the main
> application RPM because. Moreover, in all %postun blocks I execute a
> script which is provided my the main app RPM.
>
> My issue is that when I try to remove the packages with the yum remove
> command, the main app RPM is erased before the plugin RPM and in that
> case the postun scriptlets for the plugin fails because my script is not
> available anymore.
>
> As I read on the RPM and YUM doc, I used in the SPEC file the following
> instructions :
>
> Requires(post):         mainapp>= %{version}
> Requires(postun):               mainapp>= %{version}
>
> But even with this declaration, yum removes the RPM in bad order :
>
> Erasing        : mainapp 1/2
> Erasing        : mainapp-plugin 2/2
>
> /var/tmp/rpm-tmp.48257: line 1: /usr/sbin/mainapp-setup: No such file or
> directory
>
> As a note, I say that I use a unique specfile for all my application.
>
> So is there a bug with yum or do I something wrong ?
>

Please post your spec file to a pastebin for us to see.