Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
asdf
asdf
Commits
54c7597d
Commit
54c7597d
authored
Aug 11, 2015
by
Francois-Rene Rideau
Browse files
UIOP: Fix and use %run-program on ECL when applicable.
Thanks to Daniel Kochmański for his support.
parent
71f6e795
Changes
3
Hide whitespace changes
Inline
Side-by-side
test/test-program.script
View file @
54c7597d
...
...
@@ -7,8 +7,6 @@
(assert (find-system :hello-world-example))
(trace run-program #+(and sbcl os-windows) sb-ext:run-program)
;; Try to load lisp-invocation from xcvb
(initialize-source-registry
`(:source-registry
...
...
test/test-run-program.script
View file @
54c7597d
;; -*- Lisp -*-
(declaim (optimize (debug 3) (safety #-gcl 3 #+gcl 0)))
#+(and clisp os-windows)
(ext:without-package-lock ()
(trace uiop:run-program uiop/run-program::%run-program uiop/run-program::%system
ext:shell ext:run-shell-command ext:run-program))
#+(and sbcl os-windows) (trace sb-ext:run-program)
;; On Windows, normalize away CRLF into jut the unixy LF.
(defun dewindowize (x)
(block ()
...
...
@@ -93,9 +86,6 @@
(with-output-to-string (*standard-output*)
(run-program "echo ok" :output t :error-output :output)))))
;;#+allegro (trace excl:run-shell-command sys:reap-os-subprocess)
;;#+lispworks (trace system:run-shell-command system:pid-exit-status)
#|
Testing run-program
|#
...
...
uiop/run-program.lisp
View file @
54c7597d
...
...
@@ -426,10 +426,10 @@ It returns a process-info plist with possible keys:
;; NB: these implementations have unix vs windows set at compile-time.
(
declare
(
ignorable
directory
if-input-does-not-exist
if-output-exists
if-error-output-exists
))
(
assert
(
not
(
and
wait
(
member
:stream
(
list
input
output
error-output
)))))
#-
(
or
allegro
clisp
clozure
cmu
(
and
lispworks
os-unix
)
mkcl
sbcl
scl
)
#-
(
or
allegro
clasp
clisp
clozure
cmu
ecl
(
and
lispworks
os-unix
)
mkcl
sbcl
scl
)
(
progn
command
keys
directory
(
error
"run-program not available"
))
#+
(
or
allegro
clisp
clozure
cmu
(
and
lispworks
os-unix
)
mkcl
sbcl
scl
)
#+
(
or
allegro
clisp
clozure
cmu
ecl
(
and
lispworks
os-unix
)
mkcl
sbcl
scl
)
(
let*
((
%command
(
%normalize-command
command
))
(
%input
(
%normalize-io-specifier
input
:input
))
(
%output
(
%normalize-io-specifier
output
:output
))
...
...
@@ -585,7 +585,7 @@ It returns a process-info plist with possible keys:
#+
allegro
(
sys:reap-os-subprocess
:pid
process
:wait
t
)
#+
clozure
(
nth-value
1
(
ccl:external-process-status
process
))
#+
(
or
cmu
scl
)
(
ext:process-exit-code
process
)
#+
(
or
clasp
ecl
)
(
nth-value
1
(
ext:external-process-
status
process
))
#+
(
or
clasp
ecl
)
(
nth-value
1
(
ext:external-process-
wait
process
))
#+
lispworks
(
if-let
((
stream
(
or
(
getf
process-info
:input-stream
)
(
getf
process-info
:output-stream
)
...
...
@@ -909,8 +909,11 @@ or an indication of failure via the EXIT-CODE of the process"
(
setf
force-shell
t
)))
(
flet
((
default
(
x
xp
output
)
(
cond
(
xp
x
)
((
eq
output
:interactive
)
:interactive
))))
(
apply
(
if
(
or
force-shell
#+
(
or
clasp
clisp
ecl
)
(
or
(
not
ignore-error-status
)
t
)
#+
(
or
clasp
clisp
)
(
or
(
not
ignore-error-status
)
t
)
#+
clisp
(
member
error-output
'
(
:interactive
:output
))
;; old versions of ecl <= 15.3.7 don't support :error
#+
ecl
(
and
(
nth-value
1
(
ignore-errors
(
slot-value
(
ext:make-external-process
)
'ext::error
)))
(
not
(
member
error-output
'
(
:interactive
:output
nil
))))
#+
(
and
lispworks
os-unix
)
(
%interactivep
input
output
error-output
)
#+
(
or
abcl
cormanlisp
gcl
(
and
lispworks
os-windows
)
mcl
xcl
)
t
)
'%use-system
'%use-run-program
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment