aboutsummaryrefslogtreecommitdiff
path: root/src/connection.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-08-29 12:23:00 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-08-31 15:55:26 -0700
commit2248ee00ede423fc55791259099cbf7d5f57fcdc (patch)
treeaddb6d9fe9cbd4b862330ece61ebe63f200bf7e8 /src/connection.lisp
parent445b11f26b4521d8073864b6539e560d51c6174c (diff)
downloadconsfigurator-2248ee00ede423fc55791259099cbf7d5f57fcdc.tar.gz
RUN: at level 4, debug printing excludes the redirection of stdout
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection.lisp')
-rw-r--r--src/connection.lisp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/connection.lisp b/src/connection.lisp
index 99d4137..07ffa10 100644
--- a/src/connection.lisp
+++ b/src/connection.lisp
@@ -447,7 +447,8 @@ Keyword arguments accepted:
Returns command's stdout, stderr and exit code, unless :FOR-EXIT, in which
case return only the exit code."
(%process-run-args
- (let ((stdout (mktemp)))
+ (let* ((stdout (mktemp))
+ (wrapped (format nil "( ~A ) >~A" cmd stdout)))
(handler-bind
((serious-condition
(lambda (c)
@@ -456,17 +457,20 @@ case return only the exit code."
*connection*
(format nil "rm -f ~A" (escape-sh-token stdout))
nil))))
- (setq cmd (format nil "( ~A ) >~A" cmd stdout))
- (informat 4 "~&RUN ~A" cmd)
+ (informat 4 "~&RUN ~A"
+ (if (> *consfigurator-debug-level* 4) wrapped cmd))
(multiple-value-bind (err exit)
- (connection-run *connection* cmd input)
+ (connection-run *connection* wrapped input)
(let ((out (connection-readfile-and-remove *connection* stdout)))
(when inform
- (informat 1 "~& % ~A~%~{ ~A~%~}" cmd (lines out)))
+ (informat 1 "~& % ~A~%~{ ~A~%~}"
+ (if (> *consfigurator-debug-level* 4) wrapped cmd)
+ (lines out)))
(if (or may-fail (= exit 0))
(if for-exit exit (values out err exit))
(error 'run-failed
- :cmd cmd :stdout out :stderr err :exit-code exit))))))))
+ :cmd (if (> *consfigurator-debug-level* 4) wrapped cmd)
+ :stdout out :stderr err :exit-code exit))))))))
(defun mrun (&rest args)
"Like RUN but don't separate stdout and stderr (\"m\" for \"merged\"; note