On 24/11/2024 13.24, Ulrich Müller wrote:
This implements a pipestatus command, as discussed in bug 566342 [1] and on IRC.Subject to approval by the council, the command would be added in EAPI 9. Its definition in the Package Manager Specification would be along the lines of: ╓──── ║ Tests the shell's pipe status array, i.e. the exit status of the ║ command(s) in the most recently executed foreground pipeline. ║ Returns shell true (0) if all elements are zero, or the last ║ non-zero element otherwise. If called with -v as the first argument, ║ also outputs the pipe status array as a space-separated list. ╙────
Thanks again for putting effort into this ulm.When this was discussed in #-qa one initial version of pipestatus() had support for specifying non-zero exit statues as success indication for certain commands in the pipe. The prime example being 'grep' returning 1 if no input matched.
One proposed version had support for this, but it was removed in later version and the discussion in #-qa shifted towards how the value of PIPESTATUS can be preserved to be included in a potential error message.
I agree that we should drop 'assert' and that dropping it requires a sensible named alternative. And the proposed version of pipestatus() is a functional equivalent alternative.
However, I am not sure why the proposed pipestatus() does no longer include support for specifying non-zero exit statuses as success indication.
I looked forward to use pipestatus() in texlive-modules.eclass [1], but since the pipe includes a 'grep', which is not uncommon, I can not use what is currently proposed.
It seems strange to me to go this far, but then drop the ball on the last meter.
Could we please consider re-adding support for this? - Flow1: https://github.com/gentoo/gentoo/blob/11b21e623fcff8948cbbd33854ffdb2a51b2840b/eclass/texlive-module.eclass#L540-L549
OpenPGP_0x8CAC2A9678548E35.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature