public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Florian Schmaus <flow@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] New eclass: eapi9-pipestatus.eclass
Date: Wed, 27 Nov 2024 11:41:02 +0100	[thread overview]
Message-ID: <ba775d83-2532-439d-bef1-8e478475aea6@gentoo.org> (raw)
In-Reply-To: <u4j3wrf90@urania.mail-host-address-is-not-set>


[-- Attachment #1.1.1: Type: text/plain, Size: 2005 bytes --]

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?

- Flow



1: 
https://github.com/gentoo/gentoo/blob/11b21e623fcff8948cbbd33854ffdb2a51b2840b/eclass/texlive-module.eclass#L540-L549

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 21567 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 618 bytes --]

  parent reply	other threads:[~2024-11-27 10:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-24 12:24 [gentoo-dev] New eclass: eapi9-pipestatus.eclass Ulrich Müller
2024-11-24 12:58 ` Michał Górny
2024-11-24 14:12   ` Ulrich Müller
2024-11-26  6:52 ` [gentoo-dev] New eclass v2: eapi9-pipestatus.eclass Ulrich Müller
2024-11-27 10:41 ` Florian Schmaus [this message]
2024-11-27 11:52   ` [gentoo-dev] New eclass: eapi9-pipestatus.eclass Michał Górny
2024-11-27 12:32   ` Ulrich Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba775d83-2532-439d-bef1-8e478475aea6@gentoo.org \
    --to=flow@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox