From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eJ3fCthVfWFhFgEAgWs5BA (envelope-from ) for ; Sat, 30 Oct 2021 16:25:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yPt2BthVfWH7WAAAbx9fmQ (envelope-from ) for ; Sat, 30 Oct 2021 14:25:28 +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 B14EC1A8B4 for ; Sat, 30 Oct 2021 16:25:27 +0200 (CEST) Received: from localhost ([::1]:55292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgpIT-0003Pf-DU for larch@yhetil.org; Sat, 30 Oct 2021 10:25:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgpI6-0003PU-QG for guix-patches@gnu.org; Sat, 30 Oct 2021 10:25:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgpI6-0007Ur-Hp for guix-patches@gnu.org; Sat, 30 Oct 2021 10:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgpI6-0003Bp-8N for guix-patches@gnu.org; Sat, 30 Oct 2021 10:25:02 -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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Oct 2021 14:25:02 +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: Xinglu Chen Cc: 50982@debbugs.gnu.org, Maxime Devos Received: via spool by 50982-submit@debbugs.gnu.org id=B50982.163560389712246 (code B ref 50982); Sat, 30 Oct 2021 14:25:02 +0000 Received: (at 50982) by debbugs.gnu.org; 30 Oct 2021 14:24:57 +0000 Received: from localhost ([127.0.0.1]:58110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgpI0-0003BR-Mt for submit@debbugs.gnu.org; Sat, 30 Oct 2021 10:24:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgpHy-0003BA-7k for 50982@debbugs.gnu.org; Sat, 30 Oct 2021 10:24:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54434) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgpHs-0007U3-0s; Sat, 30 Oct 2021 10:24:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=ktCANwHTqn+hm/TnPQCF0xAxMu2B7PPMXUCdTt5vdLw=; b=FRuZZsp/JhT6T/TIJpE8 glTWek/n34caqqcYVnvN0fWLJcEIDuPaEtlkz/HXIYYKdLf9Z/2Mmt4L8mWwSjUG3URpFkPvCaywr Z1M25oNx8NXugXOvob049jeS4v2agOjkfrA1tKrHC/K0ZKm4WqjFuYEP1SEC3MbwjwR+UKtduxMbp UfhvvDqfgoOU9P2b23XUQ9c1uypOWrfrDpf9DOwQf8bELDRSKG3la/z31MtwE+H3MxEJSEqibOnQZ hOqZm1mzgT5yU4L032YIWfecJa3Nt22jUGom/KMNJxZUAOcWMod5L2g7/9ZPmBDIzJ2BtodYWcA+J dOSdrE9lY9EFKw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55486 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgpHr-0000Gr-LA; Sat, 30 Oct 2021 10:24:47 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <8c1286034c3a48353d13515f04883dbede289e0c.1633208618.git.public@yoctocell.xyz> <87ee827oc0.fsf@disroot.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 Brumaire an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 30 Oct 2021 16:24:45 +0200 In-Reply-To: <87ee827oc0.fsf@disroot.org> (Xinglu Chen's message of "Sat, 30 Oct 2021 13:18:39 +0200") Message-ID: <87h7cytwsy.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=1635603927; 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: content-transfer-encoding:content-transfer-encoding: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=ktCANwHTqn+hm/TnPQCF0xAxMu2B7PPMXUCdTt5vdLw=; b=H+XYgd3PKqIbW9ceL5TO1vwq5gwtC7qQSS82Bet1YoxBNIsI4imn6T7tZ3CuhakbwDc2d6 c9A1NEaMUIRvt0wILO+9icB3kxplyiIdfzWhfFyMvu+6ObmA/1tAYuJ5BC8wWonjhoU2la +HOU8lNxfXuf8yEgMB1Hkt278uSn1Pb0k5ZeoOUu/XXgML2Y5lzIsY29Nv1eTkiyzmuk1u KOJP6rhkcBuH98Rnc4GcjNISwnLeW2VR/U5ZprQcN5ZELN84XNlWVf0y3yzvwX6z4bjOl2 LNHUACm515Qs78FFmpPuxl7Y9l+IfD2mO/kHpTDHLwSAcZtCJK6fU423IOTnTQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635603927; a=rsa-sha256; cv=none; b=Up8GJ2+6yv6z6jthvM8QmpF6q+RYb03gtdRjfFkthNbJXWHucAD016vzWgXP/h6hE763Be Z99PFj5yvVimhz6urTmzuJJRfyHZA1xozOUBDubUtlK4C9FJOq3Vdi7TNAkAb/IAeBHpLI gtHh9hSwQkhyiiyPbc/y+je1nPsLHmCawkBVvN8lm/DVOjEPBj4PCRHwWxU//Nvi7tInfO pJNVpmVLhXb91dUrC2+LUqGR4NiTqOl157KHhpmaHCT++3tzkxZteKFcD7OOJz1qRhvSRb DXBdYjDrH36Bvq7W1LZA//tocFBFVNTpSLpXndXTYkX63pD5TvY08HuDyFfbwg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="FRuZZsp/"; dmarc=pass (policy=none) header.from=gnu.org; 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: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="FRuZZsp/"; dmarc=pass (policy=none) header.from=gnu.org; 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: B14EC1A8B4 X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: uRdY2HpRu3Lp Hi, Xinglu Chen skribis: > 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 havin= g 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 necessa= ry. >> 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 pac= kages). >> >> I don't know if the output of "guix system describe" and "guix home desc= ribe" >> should be an error or warning here ... > > Hmm, since I don=E2=80=99t think that not having any generations is an er= ror, 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 gen= erations > doesn=E2=80=99t really mean that something is wrong. Yeah, I guess =E2=80=98warning=E2=80=99 is fine. Maxime=E2=80=99s point is that we should always use procedures from (guix diagnostics) for error/warning/info reports. Thanks, Ludo=E2=80=99.