Error output from rpm pre/post scripts (was Re: Florian La Roche please stop mass filing bugs)

Ville Skyttä ville.skytta at iki.fi
Fri Jul 6 16:29:49 UTC 2007


On Friday 06 July 2007, Florian La Roche wrote:
> > Well, I don't remember if I was involved in that, but if we don't want
> > the scriptlet to fail and don't want to display the error output (no
> > matter whether it's because of a missing executable or some other error
> > running it), dunno if checking first adds any value.
>
> Hello Ville,
>
> what's wrong with "if test -x app; then app; fi" for this?
> Shouldn't this fix all problems?

What I was talking about in the above the difference between these two:

    app >/dev/null 2>&1 || :
    if test -x /usr/bin/app ; then /usr/bin/app >/dev/null 2>&1 || : ; fi

*But* if we want to let stderr of "app" through (or to let it cause a nonzero 
exit status, which we almost certainly don't want), then testing first is 
obviously needed.




More information about the Fedora-maintainers mailing list