From aedc745a3f9765ae00dc61a59fa53d22a458551b Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Sat, 15 Dec 2018 23:17:46 -0500 Subject: [PATCH] environment: Print command name on execlp error. Fixes . * guix/scripts/environment.scm (launch-environment): When execlp fails, include the command name in the error message. --- guix/scripts/environment.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 5965e3426..64035a740 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -389,7 +389,12 @@ variables are cleared before setting the new ones." (create-environment profile manifest #:pure? pure?) (match command ((program . args) - (apply execlp program program args)))) + (catch 'system-error + (lambda () + (apply execlp program program args)) + (lambda args + (let ((errno (system-error-errno args))) + (leave (G_ "~a: ~a~%") program (strerror errno)))))))) (define* (launch-environment/fork command profile manifest #:key pure?) "Run COMMAND in a new process with an environment containing PROFILE, with -- 2.20.0