Skip to content
Snippets Groups Projects
Commit f67c88d6 authored by Daniel Barlow's avatar Daniel Barlow
Browse files

one copy of the run-shell-command format call and docstring, please

parent fd385ef7
No related branches found
No related tags found
No related merge requests found
;;; This is asdf: Another System Definition Facility. $Revision: 1.47 $ ;;; This is asdf: Another System Definition Facility. $Revision: 1.48 $
;;; ;;;
;;; Feedback, bug reports, and patches are all welcome: please mail to ;;; Feedback, bug reports, and patches are all welcome: please mail to
;;; <cclan-list@lists.sf.net>. But note first that the canonical ;;; <cclan-list@lists.sf.net>. But note first that the canonical
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
(in-package #:asdf) (in-package #:asdf)
;;; parse the cvs revision into something that might be vaguely useful. ;;; parse the cvs revision into something that might be vaguely useful.
(defvar *asdf-revision* (let* ((v "$Revision: 1.47 $") (defvar *asdf-revision* (let* ((v "$Revision: 1.48 $")
(colon (position #\: v)) (colon (position #\: v))
(dot (position #\. v))) (dot (position #\. v)))
(and v colon dot (and v colon dot
...@@ -856,80 +856,50 @@ Returns the new tree (which probably shares structure with the old one)" ...@@ -856,80 +856,50 @@ Returns the new tree (which probably shares structure with the old one)"
;;; gratefully accepted, if they do the same thing. If the docstring ;;; gratefully accepted, if they do the same thing. If the docstring
;;; is ambiguous, send a bug report ;;; is ambiguous, send a bug report
#+sbcl
(defun run-shell-command (control-string &rest args) (defun run-shell-command (control-string &rest args)
"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and "Interpolate ARGS into CONTROL-STRING as if by FORMAT, and
synchronously execute the result using a Bourne-compatible shell, with synchronously execute the result using a Bourne-compatible shell, with
output to *trace-output*. Returns the shell's exit code." output to *trace-output*. Returns the shell's exit code."
(let ((command (apply #'format nil control-string args))) (let ((command (apply #'format nil control-string args)))
(format *trace-output* "; $ ~A~%" command) (format *trace-output* "; $ ~A~%" command)
#+sbcl
(sb-impl::process-exit-code (sb-impl::process-exit-code
(sb-ext:run-program (sb-ext:run-program
"/bin/sh" "/bin/sh"
(list "-c" command) (list "-c" command)
:input nil :output *trace-output*)))) :input nil :output *trace-output*))
#+(or cmu scl) #+(or cmu scl)
(defun run-shell-command (control-string &rest args)
"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and
synchronously execute the result using a Bourne-compatible shell, with
output to *trace-output*. Returns the shell's exit code."
(let ((command (apply #'format nil control-string args)))
(format *trace-output* "; $ ~A~%" command)
(ext:process-exit-code (ext:process-exit-code
(ext:run-program (ext:run-program
"/bin/sh" "/bin/sh"
(list "-c" command) (list "-c" command)
:input nil :output *trace-output*)))) :input nil :output *trace-output*))
;;; Added KMR 8/02 #+allegro
#+allegro (excl:run-shell-command
(defun run-shell-command (control-string &rest args) (make-array 3 :initial-contents (list "/bin/sh" "-c" command))
"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and :input nil :output *trace-output*)
synchronously execute the result using a Bourne-compatible shell, with
output to *trace-output*. Returns the shell's exit code." #+lispworks
(let ((command (apply #'format nil control-string args))) (system:call-system-showing-output
(format *trace-output* "; $ ~A~%" command) command
(excl:run-shell-command :shell-type "/bin/sh"
(make-array 3 :initial-contents (list "/bin/sh" "-c" command)) :output-stream *trace-output*)
:input nil :output *trace-output*)))
#+clisp ;XXX not exactly *trace-output*, I know
;;; Added KMR 8/02 (ext:run-shell-command command :output :terminal :wait t)
#+lispworks
(defun run-shell-command (control-string &rest args) #+openmcl
"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and
synchronously execute the result using a Bourne-compatible shell, with
output to *trace-output*. Returns the shell's exit code."
(let ((command (apply #'format nil control-string args)))
(format *trace-output* "; $ ~A~%" command)
(system:call-system-showing-output
command
:shell-type "/bin/sh"
:output-stream *trace-output*)))
#+clisp
(defun run-shell-command (control-string &rest args)
"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and
synchronously execute the result using a Bourne-compatible shell, with
output to *trace-output*. Returns the shell's exit code."
(let ((command (apply #'format nil control-string args)))
(format *trace-output* "; $ ~A~%" command)
;; XXX :terminal is not exactly *trace-output*, but it'll do
;; XXX determined the return value of this by experimentation, it
;; doesn't seem to be documented
(ext:run-shell-command command :output :terminal :wait t)))
#+openmcl
(defun run-shell-command (control-string &rest args)
"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and
synchronously execute the result using a Bourne-compatible shell, with
output to *trace-output*. Returns the shell's exit code."
(let ((command (apply #'format nil control-string args)))
(format *trace-output* "; $ ~A~%" command)
(nth-value 1 (nth-value 1
(ccl:external-process-status (ccl:external-process-status
(ccl:run-program "/bin/sh" (list "-c" command) (ccl:run-program "/bin/sh" (list "-c" command)
:input nil :output *trace-output* :wait t))))) :input nil :output *trace-output*
:wait t)))
#-(or openmcl clisp lispworks allegro scl cmu sbcl)
(error "RUN-SHELL-PROGRAM not implemented for this Lisp")
))
(pushnew :asdf *features*) (pushnew :asdf *features*)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment