mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 13:28:12 -05:00
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>
This commit is contained in:
parent
3e39b916b6
commit
6879fe235c
1 changed files with 5 additions and 2 deletions
|
@ -59,7 +59,8 @@ (define %user-profile-directory
|
|||
|
||||
(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 @@ (define (rtfm)
|
|||
%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)
|
||||
|
|
Loading…
Reference in a new issue