RPM Community Forums

Mailing List Message of <rpm-users>

Re: Is there spec file syntax to make (rpm -e) ignore errors and continue uninstall?

From: Tobias Gerschner <tobias.gerschner@gmail.com>
Date: Thu 11 Nov 2010 - 18:05:42 CET
Message-Id: <C1C7D0FC-2175-4FF6-8A00-3937A4E84A99@gmail.com>
The scriptlets are in fact shell scripts. So adding || : at the end of the line will ignore any error returned .

Alternatively you can simply add an exit 0 to always exit without error.

--
TG

On 12/11/2010, at 5:47, Joe Flowers <joe.flowers@nofreewill.com> wrote:

> Hello Everyone,
> 
> I have created a spec file and an RPM file from it but I bungled a command which uncovered an interesting problem.
> 
> 
> In the %preun section of the spec file, I mistakenly put
> 
> /etc/ini.d/mydaemon/stop
> 
> instead of
> 
> /etc/ini.d/mydaemon stop
> 
> 
> When I went to uninstall the RPM, like
> 
> rpm -e mydaemon-1.00-1
> 
> It failed on the bad (/etc/ini.d/mydaemon/stop) line and would not complete the uninstall.
> 
> So, I'm wondering if there is something that I can add to the bad
> /etc/ini.d/mydaemon/stop line in my spec file that will allow "rpm -e ..." to complete the uninstall.
> 
> 
> Analogously, I know that you can add a "-" in front of commands in a Makefile so that make will not fatally exit. I'm looking for the same functionality in the spec file.
> 
> Thanks!
> 
> Joe
> --------------
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> User Communication List                             rpm-users@rpm5.org
Received on Thu Nov 11 18:59:05 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.