From 6879fe235cd4366d57433d4154bed530ce60d874 Mon Sep 17 00:00:00 2001 From: Taylan Ulrich Bayirli/Kammer Date: Sat, 5 Jul 2014 15:36:44 +0300 Subject: guix package: Try $LOGNAME in addition to $USER. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . 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 --- guix/scripts/package.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index af86808fb5..1c3209f905 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -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) -- cgit v1.2.3