public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Gilbert <floppym@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH] acct-user.eclass: include exit status in death message
Date: Sun, 25 Jun 2023 18:15:20 -0400	[thread overview]
Message-ID: <CAJ0EP42Vg3Vjz1CLOp98xvBQNBaY09c3LWvgxb3RBR_t3drcZg@mail.gmail.com> (raw)
In-Reply-To: <4a863d6015c54ecbe9f098999158ed6c1be1511c.camel@gentoo.org>

On Sun, Jun 25, 2023 at 2:52 PM Michał Górny <mgorny@gentoo.org> wrote:
>
> I think a better approach would be to always include $? in die messages
> in Portage.

It's a nice idea, but will not work in the case where die is not
called immediately after the failing command.

A couple of possible workarounds that could be used to reset $? before
calling die:

1. Exit in a subshell: (exit ${status})
2. Return from a function: set_status() { return $1; }; set_status ${status}

In any case, I would like to apply the acct-user.eclass patch soonish
to help with debugging an error during stage building that releng
reported to me in IRC. We can revisit changing the die function and
possibly revert this patch later.


  parent reply	other threads:[~2023-06-25 22:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-25 17:51 [gentoo-dev] [PATCH] acct-user.eclass: include exit status in death message Mike Gilbert
2023-06-25 18:52 ` Michał Górny
2023-06-25 20:15   ` Oskari Pirhonen
2023-06-25 22:15   ` Mike Gilbert [this message]
2023-06-26  2:00     ` Sam James

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=CAJ0EP42Vg3Vjz1CLOp98xvBQNBaY09c3LWvgxb3RBR_t3drcZg@mail.gmail.com \
    --to=floppym@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