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: Jeff Johnson <n3npq@mac.com>
Date: Thu 11 Nov 2010 - 18:07:45 CET
Message-id: <9B5C2042-C7F1-43B2-A337-CDD9F2292B8F@mac.com>

On Nov 11, 2010, at 11:47 AM, Joe Flowers 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.
> 

There's no automated insturmented solution in *.rpm that Just Works in
spite of packaging flaws ... there are engineering flaws with
permitting random packages to start turning what RPM does on and off,
consider malware e.g.

But there is a manual disabler, in this case --nopreun, that
can be added to the command line (or set by depsolvers if/when
they ever choose to deal with the "real world" of packaging flaws),
that will skip running a buggy scriptlet when erasing.

The better fix is to test your packages more carefully ...
... but you are older & wiser now ;-)

> 
> 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.
> 

The analogue in scriptlet's of the '-' in Makefiles is

	some command || :

which ignores the exit code of a command that might fail.

hth

73 de Jeff
Received on Thu Nov 11 18:08:29 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.