GNU bug report logs - #57031
[PATCH] scripts: Show a hint the first time some commands are run as root.

Previous Next

Package: guix-patches;

Reported by: "(" <paren <at> disroot.org>

Date: Sun, 7 Aug 2022 11:15:02 UTC

Severity: normal

Tags: patch

Full log


Message #17 received at 57031 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 57031 <at> debbugs.gnu.org
Subject: Re: bug#57031: [PATCH] scripts: Show a hint the first time some
 commands are run as root.
Date: Sun, 11 Sep 2022 14:05:28 +0100
Hey Ludo,

On Mon Sep 5, 2022 at 10:11 PM BST, Ludovic Courtès wrote:
> One nitpick: Could you make moving the hint code from shell.scm to
> ui.scm a separate commit?

Sure!

> > +         (display-hint (G_ "`guix pull' is user-specific, not system-wide;
> > +running it as root will only affect the `root' user.")))
>
> Please use Texinfo markup in hints: @command{guix pull}, etc.  (Likewise
> for the second hint.)

Oh, I didn't realize you could do that.

> > +(define* (guix-package* opts #:key (root-hint? #f))
> >    "Run the 'guix package' command on OPTS, an alist resulting for command-line
> > -option processing with 'parse-command-line'."
> > +option processing with 'parse-command-line'.  If ROOT-HINT? is #T, a hint is
> > +shown on the first usage of this procedure that informs users about Guix's
> > +support for per-user package management."
> >    (with-error-handling
> > +    (when (and root-hint?
> > +               (not (hint-given? 'package-root-hint))
> > +               (= (getuid) 0))
>
> Unless I’m mistaken, ‘root-hint?’ is always true; should we just remove
> it?

No, it's not always true; we don't use `#:root-hint #t' in `guix search' and
`guix show', so that `sudo guix show foobar' doesn't trigger the root hint.

> BTW, when running ‘sudo guix install’, the hint is going to
> ~root/.cache/guix, right?

Probably -.o.-

    -- (




This bug report was last modified 2 years and 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.