From: Xinglu Chen <public@yoctocell.xyz>
To: Maxime Devos <maximedevos@telenet.be>, 50982@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#50982] [PATCH] scripts: home/system: Don’t throw an error if no generations exist.
Date: Sat, 30 Oct 2021 13:18:39 +0200 [thread overview]
Message-ID: <87ee827oc0.fsf@disroot.org> (raw)
In-Reply-To: <dcec2546aea2940cae52274422a643ef5a0189da.camel@telenet.be>
[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]
Hi,
On Sun, Oct 03 2021, Maxime Devos wrote:
> Xinglu Chen schreef op za 02-10-2021 om 23:05 [+0200]:
>> Previously, When running ‘guix home describe’ or ‘guix system describe’ 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
>
> Printing a warning instead of an error to avoid a backrace isn't necessary.
> E.g., "guix show i-do-not-exists" prints an error
> ‘guix show: error: i-do-not-exist: package not found’.
>
> 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 packages).
>
> I don't know if the output of "guix system describe" and "guix home describe"
> should be an error or warning here ...
Hmm, since I don’t think that not having any generations is an error, I
would say it makes more sense to use ‘warning’ instead of ‘leave’.
‘leave’ would signal that something isn’t correct, which makes sense if
one runs ‘guix show doesnt-exist’, but not having any generations
doesn’t really mean that something is wrong.
WDYT?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]
next prev parent reply other threads:[~2021-10-30 11:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-02 21:05 [bug#50982] [PATCH] scripts: home/system: Don’t throw an error if no generations exist Xinglu Chen
2021-10-03 8:53 ` Maxime Devos
2021-10-19 13:59 ` Ludovic Courtès
2021-10-30 11:18 ` Xinglu Chen [this message]
2021-10-30 14:24 ` Ludovic Courtès
2022-01-06 10:28 ` bug#50982: " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ee827oc0.fsf@disroot.org \
--to=public@yoctocell.xyz \
--cc=50982@debbugs.gnu.org \
--cc=ludo@gnu.org \
--cc=maximedevos@telenet.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).