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 962D7158009 for ; Sun, 25 Jun 2023 20:15:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ECCC0E08F0; Sun, 25 Jun 2023 20:15:19 +0000 (UTC) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (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 C047CE08BE for ; Sun, 25 Jun 2023 20:15:19 +0000 (UTC) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-991aac97802so61787066b.1 for ; Sun, 25 Jun 2023 13:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687724118; x=1690316118; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=fomcupPqdgas+2F3fQVqYkafk2mureiCy+V0k3G7oIY=; b=SQr7W7pCSjUQ/EI+LPqbgnUIaQYNpAbZhSwGGdanxYx3BkwT05cY/xpEkxsL6SU3/e DtiXDvH5WMugN4l0SNJHJPEOt8acI8SFSCGdVzB7yR4JPOK8rHY2zGUAkrQskHVT45nO v7YNG8WKGRoHsppRiXjhGHldKcRQuogYGithK8nKYGX6ljhB+l4BcNmH5JoTYryYRpp6 IhGZtP0LNoHfU55NlgtSmOvbU4K0HvedGYTnNtkkSzKH9xOxOhNxkA88HBjZQoGOfaWF 2u4Z5ePtqm1YCMb9FICTwcRHOJQR5gPDyV8kvKMTJH8pCsqE8wMpluyjtql4VuHT6u6D 1g+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687724118; x=1690316118; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fomcupPqdgas+2F3fQVqYkafk2mureiCy+V0k3G7oIY=; b=HKJa3KcnjdTYDfeFlDaKnBj5Pr8DjiZxhktH1NZDNGkc5UvGt5KtUOstAB4i6vsMPM ArU1BLBGdQHSkNpA2ZoJDvQy4IrXD/MFOSBMGN6wJauP2FvzOIlH10Eolg4gn0Z0SVxO mEmeY1/UHn1IheOGHB8yaBn3OnHpG7/gry6skQXYU/6FBL+rsbFBt0Tw55u0GCwDlUoM tipvRQLV3DTU3eXU1VyUxMeY2Yz3TVChjDGWIAbxQSDW57rAtYWGZmoUpKIZbIAbYQjT Y8izPxuvQhVJ4wQ+ndmKXpzW84IOCzcAPj1WWjoEFBTIwBo34Vm7/fwfK+XcTmoFMUvO ZFVw== X-Gm-Message-State: AC+VfDyjQg5pyXjr4N2eoZpuVfMK/aErsnlQFDtJYMm2pbbomchKCI5x scQZWs+J+0yNtDDfh1i8DVMslsSjNA8= X-Google-Smtp-Source: ACHHUZ4HZfpgD7nz3+u6dGQdsu4s6jM1saQdKQEaKQ7lBq+kgm0dkTYbCnT2bSklNyXhS6bfjWrqKA== X-Received: by 2002:a17:907:96ab:b0:991:d2a8:658a with SMTP id hd43-20020a17090796ab00b00991d2a8658amr99995ejc.34.1687724118418; Sun, 25 Jun 2023 13:15:18 -0700 (PDT) Received: from dj3ntoo (140.sub-75-226-201.myvzw.com. [75.226.201.140]) by smtp.gmail.com with ESMTPSA id pg10-20020a170907204a00b0096f67b55b0csm2423392ejb.115.2023.06.25.13.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jun 2023 13:15:17 -0700 (PDT) Date: Sun, 25 Jun 2023 15:15:12 -0500 From: Oskari Pirhonen To: =?utf-8?B?TWljaGHFgiBHw7Nybnk=?= Cc: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH] acct-user.eclass: include exit status in death message Message-ID: Mail-Followup-To: =?utf-8?B?TWljaGHFgiBHw7Nybnk=?= , gentoo-dev@lists.gentoo.org References: <20230625175156.1368764-1-floppym@gentoo.org> <4a863d6015c54ecbe9f098999158ed6c1be1511c.camel@gentoo.org> 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 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tPOomy+n7uVEDYqO" Content-Disposition: inline In-Reply-To: <4a863d6015c54ecbe9f098999158ed6c1be1511c.camel@gentoo.org> X-Archives-Salt: 60b53d4d-d174-47c6-b0be-ea950f7f7778 X-Archives-Hash: 57ce2419196d1803514e34e239c6291d --tPOomy+n7uVEDYqO Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 25, 2023 at 20:52:53 +0200, Micha=C5=82 G=C3=B3rny wrote: > I think a better approach would be to always include $? in die messages > in Portage. >=20 I'm not sure the exit code is useful in the general case. Something like rm(1) seems to give the same exit code despite failing for different reasons: $ rm /tmp/root_owned=20 rm: remove write-protected regular empty file '/tmp/root_owned'? y rm: cannot remove '/tmp/root_owned': Operation not permitted $ echo $? 1 $ rm /tmp/nonexistent rm: cannot remove '/tmp/nonexistent': No such file or directory $ echo $? 1 On the other hand, groupadd(8) (at least) seems to have useful exit codes. From the man page: EXIT VALUES The groupadd command exits with the following values: =20 0 success =20 2 invalid command syntax =20 3 invalid argument to option =20 4 GID is already used (when called without -o) =20 9 group name is already used =20 10 can't update group file - Oskari --tPOomy+n7uVEDYqO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQfOU+JeXjo4uxN6vCp8he9GGIfEQUCZJigTAAKCRCp8he9GGIf EfB2AP0btc9RWc0IDqV5/POkoSa8WEUci6ZGyWbpaRgT+eEf8gD/b8CkH88RYfpb KIt1H/jyMeJB9CprpGJtRW/qWhZnhAk= =2d/A -----END PGP SIGNATURE----- --tPOomy+n7uVEDYqO--