From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A401C158009 for ; Sun, 25 Jun 2023 22:15:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A8639E08CA; Sun, 25 Jun 2023 22:15:34 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 66A5DE0897 for ; Sun, 25 Jun 2023 22:15:34 +0000 (UTC) Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-5703d12ab9aso28271127b3.2 for ; Sun, 25 Jun 2023 15:15:33 -0700 (PDT) X-Gm-Message-State: AC+VfDxtTK6VMMlJ+JHDLFY3Hd+IXPfFS3HKEIVy2SkX78MBNUaFBjqC yhy+aP3MLrgQdpcYnBeFc+biWWP2U4U3AC5fEC0= X-Google-Smtp-Source: ACHHUZ42AefGPbHsikdH3dcgNJQdFopcCWi/rsXm0gKx1Al/E4tjvdDc/ad0BuIP8srUw1MMlaq7lMAwC8M7NXIGFU4= X-Received: by 2002:a0d:df54:0:b0:570:8b91:256 with SMTP id i81-20020a0ddf54000000b005708b910256mr25966557ywe.43.1687731331485; Sun, 25 Jun 2023 15:15:31 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: <20230625175156.1368764-1-floppym@gentoo.org> <4a863d6015c54ecbe9f098999158ed6c1be1511c.camel@gentoo.org> In-Reply-To: <4a863d6015c54ecbe9f098999158ed6c1be1511c.camel@gentoo.org> From: Mike Gilbert Date: Sun, 25 Jun 2023 18:15:20 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-dev] [PATCH] acct-user.eclass: include exit status in death message To: gentoo-dev@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 4d6928a8-5cae-45ca-887d-33fc6fb83f64 X-Archives-Hash: c537eb0ed462df3d87ff436e9536911d On Sun, Jun 25, 2023 at 2:52=E2=80=AFPM Micha=C5=82 G=C3=B3rny 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.