Subject: Re: bug#17946: Try LOGNAME in addition to USER
From: [email-masked] (Ludovic Courtès)
To: Taylan Ulrich Bayirli/Kammer <[email-masked]>
Cc: [email-masked]
Date: Sat, 05 Jul 2014 15:12:48 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Taylan Ulrich Bayirli/Kammer <[email-masked]> skribis:

> Cron jobs may set the LOGNAME environment variable but no USER,
> e.g. under Debian 7 (wheezy).  In that case 'guix package' fails to
> use $localstatedir/guix/profiles/per-user/$user.  From a quick grep I
> couldn't find more places in Guix where USER is used, so here's a
> patch that just does it straightforwardly in two places in
> scripts/package.scm, but perhaps a more generic solution would be good
> for the future.

Good catch.  I agree we’ll need to factorize that eventually.

> From 902267cf99aacaea994cc95b77551f0d2bd35836 Mon Sep 17 00:00:00 2001
> From: Taylan Ulrich B <[email-masked]>
> Date: Sat, 5 Jul 2014 15:28:50 +0300
> Subject: [PATCH] Try LOGNAME in addition to USER.
>
> Notoriously, cron jobs may set LOGNAME only and not USER.  See
> e.g. crontab(5) under Debian 7 (wheezy).
>
> * guix/scripts/package.scm (%profile-directory)
> (guix-package): Also try LOGNAME if USER is unset.

Pushed after tweaking the commit log.

Thanks!

Ludo’.