Hi, On Mon, 2 Dec 2019 at 21:55, YOANN P <[email protected]> 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, simon
