Ticket #849 (assigned enhancement)

Opened 9 months ago

Last modified 8 months ago

RFE: no-error flag for scriptlets

Reported by: scop Assigned to: pmatilai (accepted)
Priority: major Milestone:
Component: rpm Version: RPM Development
Keywords: Cc:

Description

There's a lot of unnecessary "exit 0" or " :" and the like cruft in countless specfiles whose purpose is to avoid scriptlets exiting with non-zero exit codes.

Having a no-error flag that'd make the exit status always 0 would provide an easy way to accomplish that, for example %post -e -p /bin/false. It'd also provide a way to do this for scriptlet programs without a script body, for example the /bin/false example above, or %post -e -p /sbin/ldconfig etc.

Change History

09/12/11 06:37:01 changed by pmatilai

  • owner changed from RpmTickets to pmatilai.
  • status changed from new to assigned.

Another fine idea - while most of the "exit 0" etc cruft comes from the times where rpm used to leave duplicates behind on scriptlet failure (which is no longer the case), such cases still issue a "warning" level scriptlet error callback (which at least yum logs as a "non-fatal scriptlet error"). A no-error flag could be used to disable that too, and would allow silencing bodiless scriptlet failures which currently is impossible.

The scriptlet exit status is a bit of a gray area though: its one thing to suppress errors when a scriptlet runs successfully but terminates with non-zero exit code, scriptlets failing to execute at all because of a missing interpreter or dying with a signal seem "more serious errors", but rpm doesn't really differentiate between these other than logging a different error message in each case. So while suppressing non-zero exit "errors" with such a flag seems obvious, the others are less clear. IIRC there's also an RFE for "strict" error behavior somewhere (probably RH bugzilla)...