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 70912158009 for ; Sun, 25 Jun 2023 17:52:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 20601E08FA; Sun, 25 Jun 2023 17:52:00 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 CFE3AE08DD for ; Sun, 25 Jun 2023 17:51:59 +0000 (UTC) From: Mike Gilbert To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] [PATCH] acct-user.eclass: include exit status in death message Date: Sun, 25 Jun 2023 13:51:56 -0400 Message-ID: <20230625175156.1368764-1-floppym@gentoo.org> X-Mailer: git-send-email 2.41.0 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-Transfer-Encoding: 8bit X-Archives-Salt: 14371a4a-c9ee-477d-8e42-ceb44235d92a X-Archives-Hash: 40e87b0e6e528a37b06894ab45cb815e Signed-off-by: Mike Gilbert --- eclass/acct-group.eclass | 2 +- eclass/acct-user.eclass | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass index 8d2d3adb7221..a0ad86066309 100644 --- a/eclass/acct-group.eclass +++ b/eclass/acct-group.eclass @@ -179,7 +179,7 @@ acct-group_pkg_preinst() { fi elog "Adding group ${ACCT_GROUP_NAME}" - groupadd "${opts[@]}" "${ACCT_GROUP_NAME}" || die + groupadd "${opts[@]}" "${ACCT_GROUP_NAME}" || die "groupadd failed with status $?" } fi diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass index 88d7d354c8e6..b03bf0f1ab28 100644 --- a/eclass/acct-user.eclass +++ b/eclass/acct-user.eclass @@ -362,7 +362,7 @@ acct-user_pkg_preinst() { fi elog "Adding user ${ACCT_USER_NAME}" - useradd "${opts[@]}" "${ACCT_USER_NAME}" || die + useradd "${opts[@]}" "${ACCT_USER_NAME}" || die "useradd failed with status $?" _ACCT_USER_ADDED=1 fi @@ -454,7 +454,7 @@ acct-user_pkg_postinst() { eerror " usermod ${optsq[@]} ${ACCT_USER_NAME}" else eerror "$(<"${T}/usermod-error.log")" - die "usermod failed" + die "usermod failed with status ${status}" fi fi } @@ -502,7 +502,7 @@ acct-user_pkg_prerm() { fi elog "Locking user ${ACCT_USER_NAME}" - usermod "${opts[@]}" "${ACCT_USER_NAME}" || die + usermod "${opts[@]}" "${ACCT_USER_NAME}" || die "usermod failed with status $?" } fi -- 2.41.0