From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eMZXI0UqfWGisgAAgWs5BA (envelope-from ) for ; Sat, 30 Oct 2021 13:19:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8PTnHkUqfWHcXgAAbx9fmQ (envelope-from ) for ; Sat, 30 Oct 2021 11:19:33 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2DE4536121 for ; Sat, 30 Oct 2021 13:19:33 +0200 (CEST) Received: from localhost ([::1]:59438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgmOa-00011L-Cq for larch@yhetil.org; Sat, 30 Oct 2021 07:19:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgmO6-00010h-9g for guix-patches@gnu.org; Sat, 30 Oct 2021 07:19:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgmO6-0002Y3-1J for guix-patches@gnu.org; Sat, 30 Oct 2021 07:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgmO5-0003h9-OV for guix-patches@gnu.org; Sat, 30 Oct 2021 07:19:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50982] [PATCH] scripts: home/system: =?UTF-8?Q?Don=E2=80=99t?= throw an error if no generations exist. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Oct 2021 11:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50982 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos , 50982@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 50982-submit@debbugs.gnu.org id=B50982.163559272714180 (code B ref 50982); Sat, 30 Oct 2021 11:19:01 +0000 Received: (at 50982) by debbugs.gnu.org; 30 Oct 2021 11:18:47 +0000 Received: from localhost ([127.0.0.1]:56783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgmNr-0003ge-6O for submit@debbugs.gnu.org; Sat, 30 Oct 2021 07:18:47 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:36980 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgmNp-0003gR-RT for 50982@debbugs.gnu.org; Sat, 30 Oct 2021 07:18:46 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635592720; bh=yK1SEsv7tDnrYRCMRd43lGhqAxaep8AK/Hv9KH1xFc0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=bcrtyXhtdqKixVw8Xaim2KJFx020Edj05HgBhzoyp9zJWLFOZ8RdZGe5dgD4tF96w MpOKE+PYxMATkaQnAsGtTCYBeR3+wLcZ5y4U7HMUvGVeLfRkdeGpzvwDhCrGDo68bM chGpDe2lP8h6Sdlju7sdLeeanuPPaEAvsoH0blMM= In-Reply-To: References: <8c1286034c3a48353d13515f04883dbede289e0c.1633208618.git.public@yoctocell.xyz> Date: Sat, 30 Oct 2021 13:18:39 +0200 Message-ID: <87ee827oc0.fsf@disroot.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635592773; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=dg3Zf4R32DH0RDevW+oXpaQaPqudrIlD3ONAjRLIYC4=; b=XAuNRbtppqDy41di5r4GPPuQufYiO3NN50VnKqlaj+UYOdiJmGZB4aCmEqWpqyFKgnHsnx whmIM8bQsKSlISwvuGzOWVmBvIaDoe7Y/XT40zOQh3HWOkO4haer56bzFS3FjYbm1nAo3+ K3DfLmsycR3jpv5tqVaHVdmQUhU7yPn9050hMvfckOXwdVUOEhHh5y4g7zCMHlEmp/DKlQ akHdrwzYBg0NNfWJiFe2mF9SkP8mDspc+4E27wted+sqoFlWLfA1xRXqm410TzLxKO3cbM 4Btjds9doxIFuAz4OCyWGVnkISJGyH/xVDMvdzJWeDe/xUUA5rRChWhgDc9K0Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635592773; a=rsa-sha256; cv=none; b=l/jTTXHb7HObuQLiisB/QljAS1jOWA87JfO3zv1b2Hy1fOwEX7AiCTNT4Nxr4ec/jr2Od/ uO0Cii04FOKVxdhMCeX1pmdwTB+hJRi60pOsscwLilMXyEt+oUUgGOIES6IVYD4SiJynLk Gx+ol0rVsLMLMaXK5JYCRFGs2li3K51n9AkQ7uyawW1LB7far+S7otG2ub7CIRjlhEwKHI ptCz0o9qVnVNwaCKCi9UKjQgcZ3Qv3210CDeYRU0L9bF+iksNwGpsSMHXlEvzPv9v8BpYe MMoGstlrxRWFaN9K7VLaJgyeP8yaKPy0VakVo1ol2fJTQSUVchaBq6QHxXzENQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=bcrtyXht; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.42 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=bcrtyXht; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 2DE4536121 X-Spam-Score: -3.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: bPEw39xENyTQ --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, On Sun, Oct 03 2021, Maxime Devos wrote: > Xinglu Chen schreef op za 02-10-2021 om 23:05 [+0200]: >> Previously, When running =E2=80=98guix home describe=E2=80=99 or =E2=80= =98guix system describe=E2=80=99 prior >> to having any generations, a backtrace would produced. Since not having= any >> existing generations is not an error, a warning would be enough. >>=20 >> $ guix system describe >> guix system: warning: no system generation, nothing to describe > > Printing a warning instead of an error to avoid a backrace isn't necessar= y. > E.g., "guix show i-do-not-exists" prints an error > =E2=80=98guix show: error: i-do-not-exist: package not found=E2=80=99. > > I suggest using (leave (G_ "bla bla")) instead of (error (G_ "bla bla")) > for these kind of errors, it appears to work '%find-package' in (gnu pack= ages). > > I don't know if the output of "guix system describe" and "guix home descr= ibe" > should be an error or warning here ... Hmm, since I don=E2=80=99t think that not having any generations is an erro= r, I would say it makes more sense to use =E2=80=98warning=E2=80=99 instead of = =E2=80=98leave=E2=80=99. =E2=80=98leave=E2=80=99 would signal that something isn=E2=80=99t correct, = which makes sense if one runs =E2=80=98guix show doesnt-exist=E2=80=99, but not having any gener= ations doesn=E2=80=99t really mean that something is wrong. WDYT? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmF9Kg8VHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5W6cP/219MvUYkwuoH4+/7yCUZqYeoHQx at9EDmf6Qynah5/kz0xPlhN81Dpmd0RzHCXp9o6wqIaReEaBvLTLc8OdN9iz3V2y D3BBOIEmCoe6XfSP0cwHQ1Of5hlrbIp1pOc+jLk8gqrXJRswaB07UfRiqD45u+eV 1P+JxkAnFCC2mXvV0YWu1xPGp2XOe8DzJgj7+FGJQCTPbn2/nBvJIBWCphSNNV5N XaGTNW5CfT4IwbFbt34pa62xkuW9uLz9Rws78tDBHQ2CfmOjAfowvCGlx0eO1XZ/ BKTxUJYthTYfkRxUeY7UH7Oc+RWcBRt1+EV/9JPZY1UmBiYiMMhnBwE53SdhOGhg ElOpwXxWmphRg+m3vsnourDL2Qpxg60EjhjiRL73nzQtZkPlr0YPSZQ997WRAAAn NOLEOCDyC2qfAsl90ORVNtoq9Z8JxnyzYvVsWbaE8D0ZeJReK1IcHsL2h/z18TD7 y5F2wcH2t5uiBeJY2mszlqlirjgfgpvR9PgWC96bNqQbwcrtLyIYKW7OwekByK4A /TPyK73pr8NGMoU1Z1h+CKAjB2xgq8PUuwGSjR7ME23plv5n5QTkoIOHVTDCjveU O0tw6DkIemyrx7htBuLyiMRmwAbOgKLMzGp3fk4Nj36VHLmmwr7PmHt99pvL2iuL 8a18YcF1l/mXGWg2 =qMIu -----END PGP SIGNATURE----- --=-=-=--