Commit ce34bacc authored by Elias Pipping's avatar Elias Pipping Committed by Robert Goldman
Browse files

Have (run|launch)-program's :*put default to NIL

Prior to this change, run-program's (but not launch-program's)
:error-output and :input would default to :interactive if :output was
interactive. See also https://bugs.launchpad.net/asdf/+bug/1638870
parent 0ba056fa
...@@ -475,8 +475,9 @@ either a list of strings specifying a program and list of arguments, ...@@ -475,8 +475,9 @@ either a list of strings specifying a program and list of arguments,
or a string specifying a shell command (/bin/sh on Unix, CMD.EXE on or a string specifying a shell command (/bin/sh on Unix, CMD.EXE on
Windows) _asynchronously_. Windows) _asynchronously_.
If OUTPUT is a pathname, a string designating a pathname, or NIL If OUTPUT is a pathname, a string designating a pathname, or NIL (the
designating the null device, the file at that path is used as output. default) designating the null device, the file at that path is used as
output.
If it's :INTERACTIVE, output is inherited from the current process; If it's :INTERACTIVE, output is inherited from the current process;
beware that this may be different from your *STANDARD-OUTPUT*, and beware that this may be different from your *STANDARD-OUTPUT*, and
under SLIME will be on your *inferior-lisp* buffer. If it's T, output under SLIME will be on your *inferior-lisp* buffer. If it's T, output
...@@ -1065,9 +1066,9 @@ or :error-output." ...@@ -1065,9 +1066,9 @@ or :error-output."
(defun run-program (command &rest keys (defun run-program (command &rest keys
&key ignore-error-status (force-shell nil force-shell-suppliedp) &key ignore-error-status (force-shell nil force-shell-suppliedp)
(input nil inputp) (if-input-does-not-exist :error) input (if-input-does-not-exist :error)
output (if-output-exists :supersede) output (if-output-exists :supersede)
(error-output nil error-output-p) (if-error-output-exists :supersede) error-output (if-error-output-exists :supersede)
(element-type #-clozure *default-stream-element-type* #+clozure 'character) (element-type #-clozure *default-stream-element-type* #+clozure 'character)
(external-format *utf-8-external-format*) (external-format *utf-8-external-format*)
&allow-other-keys) &allow-other-keys)
...@@ -1084,8 +1085,8 @@ specified to be NIL. ...@@ -1084,8 +1085,8 @@ specified to be NIL.
Signal a continuable SUBPROCESS-ERROR if the process wasn't successful (exit-code 0), Signal a continuable SUBPROCESS-ERROR if the process wasn't successful (exit-code 0),
unless IGNORE-ERROR-STATUS is specified. unless IGNORE-ERROR-STATUS is specified.
If OUTPUT is a pathname, a string designating a pathname, or NIL designating the null device, If OUTPUT is a pathname, a string designating a pathname, or NIL (the default)
the file at that path is used as output. designating the null device, the file at that path is used as output.
If it's :INTERACTIVE, output is inherited from the current process; If it's :INTERACTIVE, output is inherited from the current process;
beware that this may be different from your *STANDARD-OUTPUT*, beware that this may be different from your *STANDARD-OUTPUT*,
and under SLIME will be on your *inferior-lisp* buffer. and under SLIME will be on your *inferior-lisp* buffer.
...@@ -1147,23 +1148,23 @@ or an indication of failure via the EXIT-CODE of the process" ...@@ -1147,23 +1148,23 @@ or an indication of failure via the EXIT-CODE of the process"
(unless force-shell-suppliedp (unless force-shell-suppliedp
#-(and sbcl os-windows) ;; force-shell t isn't working properly on windows as of sbcl 1.2.16 #-(and sbcl os-windows) ;; force-shell t isn't working properly on windows as of sbcl 1.2.16
(setf force-shell t))) (setf force-shell t)))
(flet ((default (x xp output) (cond (xp x) ((eq output :interactive) :interactive)))) (apply (if (or force-shell
(apply (if (or force-shell #+(or clasp clisp) t
#+(or clasp clisp) t ;; A race condition in ECL <= 16.0.0 prevents using ext:run-program
;; A race condition in ECL <= 16.0.0 prevents using ext:run-program #+ecl #.(if-let (ver (parse-version (lisp-implementation-version)))
#+ecl #.(if-let (ver (parse-version (lisp-implementation-version))) (lexicographic<= '< ver '(16 0 1)))
(lexicographic<= '< ver '(16 0 1))) #+(and lispworks os-unix) (%interactivep input output error-output)
#+(and lispworks os-unix) (%interactivep input output error-output) #+(or cormanlisp gcl (and lispworks os-windows) mcl xcl) t)
#+(or cormanlisp gcl (and lispworks os-windows) mcl xcl) t) '%use-system '%use-launch-program)
'%use-system '%use-launch-program) command
command :input input
:input (default input inputp output) :output output
:error-output (default error-output error-output-p output) :error-output error-output
:if-input-does-not-exist if-input-does-not-exist :if-input-does-not-exist if-input-does-not-exist
:if-output-exists if-output-exists :if-output-exists if-output-exists
:if-error-output-exists if-error-output-exists :if-error-output-exists if-error-output-exists
:element-type element-type :external-format external-format :element-type element-type :external-format external-format
keys))) keys))
;; WARNING: For signals other than SIGTERM and SIGKILL this may not ;; WARNING: For signals other than SIGTERM and SIGKILL this may not
;; do what you expect it to. Sending SIGSTOP to a process spawned ;; do what you expect it to. Sending SIGSTOP to a process spawned
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment