me
/
guix
Archived
1
0
Fork 0

guix package: Try $LOGNAME in addition to $USER.

Fixes <http://bugs.gnu.org/17946>.

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.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
master
Taylan Ulrich Bayirli/Kammer 2014-07-05 15:36:44 +03:00 committed by Ludovic Courtès
parent 3e39b916b6
commit 6879fe235c
1 changed files with 5 additions and 2 deletions

View File

@ -59,7 +59,8 @@
(define %profile-directory
(string-append %state-directory "/profiles/"
(or (and=> (getenv "USER")
(or (and=> (or (getenv "USER")
(getenv "LOGNAME"))
(cut string-append "per-user/" <>))
"default")))
@ -808,7 +809,9 @@ more information.~%"))
%profile-directory)
(format (current-error-port)
(_ "Please change the owner of `~a' to user ~s.~%")
%profile-directory (or (getenv "USER") (getuid)))
%profile-directory (or (getenv "USER")
(getenv "LOGNAME")
(getuid)))
(rtfm))))
(define (process-actions opts)