From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0bQHE9DJWGEbUQAAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 23:06:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eLtFDtDJWGHBXgAAB5/wlQ (envelope-from ) for ; Sat, 02 Oct 2021 21:06:24 +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 8BC943594B for ; Sat, 2 Oct 2021 23:06:23 +0200 (CEST) Received: from localhost ([::1]:47476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWmD8-00071a-6Z for larch@yhetil.org; Sat, 02 Oct 2021 17:06:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWmCp-00070S-On for guix-patches@gnu.org; Sat, 02 Oct 2021 17:06:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWmCp-0000iw-CQ for guix-patches@gnu.org; Sat, 02 Oct 2021 17:06:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWmCo-0004AM-FM; Sat, 02 Oct 2021 17:06: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: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: maximedevos@telenet.be, guix-patches@gnu.org Resent-Date: Sat, 02 Oct 2021 21:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50982 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50982@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Maxime Devos Received: via spool by submit@debbugs.gnu.org id=B.163320875815989 (code B ref -1); Sat, 02 Oct 2021 21:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Oct 2021 21:05:58 +0000 Received: from localhost ([127.0.0.1]:60721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWmCj-00049n-Py for submit@debbugs.gnu.org; Sat, 02 Oct 2021 17:05:58 -0400 Received: from lists.gnu.org ([209.51.188.17]:50860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWmCi-00049V-1P for submit@debbugs.gnu.org; Sat, 02 Oct 2021 17:05:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWmCh-0006zf-ME for guix-patches@gnu.org; Sat, 02 Oct 2021 17:05:55 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:55238 helo=mail.yoctocell.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWmCe-0000XS-NY for guix-patches@gnu.org; Sat, 02 Oct 2021 17:05:54 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1633208748; bh=DFxrS4/6G3q7aKSOBrXHfBZ2BQqLG6QsfAKuxsfC2P0=; h=From:To:Subject:Date; b=r9AAdtnIs1SD7KM5faw1Bb8hF+KLjBZf6AxSOMufBNnnBWRp32Gyn1sxxkW85R2iG M9hHmUNuojtQZNhjvpT2k7bbwTOzLVxB2JfvYIVCv6WSuw1KbVN1ZKfQ8zGWS+ySN0 dTWu8g6waBlXsrSg+haPxaVfKBK5fcxTvih4iKXU= Message-Id: <8c1286034c3a48353d13515f04883dbede289e0c.1633208618.git.public@yoctocell.xyz> Date: Sat, 02 Oct 2021 23:05:48 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 39 X-Spam_score: 3.9 X-Spam_bar: +++ X-Spam_report: (3.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.5, FROM_SUSPICIOUS_NTLD_FP=0.233, PDS_OTHER_BAD_TLD=1.999, PDS_RDNS_DYNAMIC_FP=0.001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TO_NO_BRKTS_DYNIP=2.299 autolearn=no autolearn_force=no X-Spam_action: no action 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=1633208783; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=SVaM/5hqMngHM5Vpvvg1CDEv7k7RDB76dJMcW/YqsXI=; b=lNy/xczQ6IVxmdttF/wf/qvkdxjyh/kWyuRZHN3NnqKlY4BZ9W5hnNl1XhCbw7Vqm1PjUt u4ICBDQTchlal/GRWn0y6uinIel07xq3dKk4/Nu3lytNqHOTXPxveHmBn64n9o2HTda2oO cC0xnrOD0N0l8DNW9YKAfRD7O3/vkWHUezogX8eissuCqujy7YGfLmY9z9r22ioyI1L+vV rYtwBfUdQ/L7n5IHUhPjFfoHLN3H+LIr51U7IIaN6cbN7gX3RBXpvKZ1pUKYeyrXePzUoB +cgljDxAfWhjvVXKt+/c6YhDlBu+QGJqlXhhU5q+vZ7LtZubK9b05MaNwakoWg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633208783; a=rsa-sha256; cv=none; b=XP+2buF5E38h/8wNLSk8a1hBFkgXpU3LvY99n3O8DE9z/ZjbAneTOe2+GC7GYcoZPQ4Bgr 1jKCw+52p6cUUgqFsB4W3lP3jqs5HqMFxdW7g8DacBmWUSueIdUKf99NHFiIDNHIxTNAZ7 ZNBSrsG+2vYDXP5bOBs9ywoOvuGFOL5vZv9k2x3pQZwSdVcO/W4HFGTyLnI9rER2dzgKF8 Pi3DeMugc9PAtV4QJsuHfPuAkIbEI2rolY4MWP311o/dKvggBCgHUuFjihVpBV+4rJLwkx O5zPLq0rwBIv8E/ACi9QQLMr4z1W6icG79ss/HHIBTOXWgVPv7Ksik+wHwf3tw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=r9AAdtnI; 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: -0.91 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=r9AAdtnI; 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: 8BC943594B X-Spam-Score: -0.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: DlZtLikyNmez Previously, When running =E2=80=98guix home describe=E2=80=99 or =E2=80=98g= uix 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. $ guix system describe guix system: warning: no system generation, nothing to describe * guix/scripts/home.scm (process-command): Produce a warning instead of an error if no generations exist. * guix/scripts/system.scm (process-command): Likewise. Fixes: Reported-by: Maxime Devos --- guix/scripts/home.scm | 2 +- guix/scripts/system.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 75df6d707d..70860564eb 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -260,7 +260,7 @@ (define-syntax-rule (with-store* store exp ...) ((describe) (match (generation-number %guix-home) (0 - (error (G_ "no home environment generation, nothing to describe~%"= ))) + (warning (G_ "no home environment generation, nothing to describe~= %"))) (generation (display-home-environment-generation generation)))) ((list-generations) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 65eb98e4b2..d77d3ea289 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -1307,7 +1307,7 @@ (define-syntax-rule (with-store* store exp ...) ((describe) (match (generation-number %system-profile) (0 - (error (G_ "no system generation, nothing to describe~%"))) + (warning (G_ "no system generation, nothing to describe~%"))) (generation (display-system-generation generation)))) ((search) base-commit: f1a3c11407b52004e523ec5de20d326c5661681f --=20 2.33.0