[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guix gc doesn't seem to clean old guix revision

From: zimoun
Subject: Re: guix gc doesn't seem to clean old guix revision
Date: Mon, 2 Dec 2019 22:51:32 +0100


On Mon, 2 Dec 2019 at 21:55, YOANN P <address@hidden> wrote:

> > I do not understand: running without any $USER is kind of very special
> > edge case.
> It is not special at all, $USER is only set when using a login shell.
> So if you script some guix commands (who doesn't use a login shell),
> it broke as it broke with my tests.

You have right about $USER. But it is not so common because the case
has not been encountered too much already. ;-)

> There is a user, this is just that the shell used is not a login shell.
> Since $USER/$HOME are only set when using a login shell, it is
> better to use `whoami` in place of $USER and expand ~$(whoami)
> in place of $HOME in scripts to be sure to have the right values even
> when using a non-login shell or to avoid errors if $USER was override.

You are proposing to avoid the call to '(or (getenv "USER") (getenv
"LOGNAME"))' in guix/profiles.scm and guix/store.scm and instead to
rely on the command "whoami" from the coreutils package, right?
Other said, instead of falling in the "default" case in
%profile-directory, call the whoami command, right?

Is whoami exposed in Guile?

Thank you for the explanations.

All the best,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]