Commit b0b8a8bc authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Fix the default suffix and type of with-temporary-file.

Fix the the handling of :directory in run-program when using system.
parent fde68061
......@@ -13,15 +13,17 @@
(defun system-lisp-files (system)
(loop :for f :in (required-components system :keep-component 'cl-source-file)
:collect (enough-namestring (component-pathname f) *asdf-directory*)))
:collect (namestring (enough-pathname (component-pathname f) *asdf-directory*))))
(defun makefile-lisp-files (target)
(remove-if 'emptyp
(split-string ;; NB: assumes GNU make
(run-program `("make" "--quiet" "--no-print-directory" ,target)
:output :string :error-output t :directory *asdf-directory*)
:separator #(#\space #\newline #\return #\tab))))
#+clisp (trace run-program reduce/strcat)
(defmacro compare-files (system target)
`(assert-equal (system-lisp-files ,system) (makefile-lisp-files ,target)))
......@@ -761,7 +761,8 @@ It returns a process-info plist with possible keys:
before (redirect in " <") (redirect out " >") (redirect err " 2>")
(when (and directory (os-unix-p)) `("cd " (escape-shell-token directory) " ; "))
(when (and directory (os-unix-p))
`(" ; cd " ,(escape-shell-token (native-namestring directory))))
(defun %system (command &rest keys
......@@ -535,14 +535,15 @@ If a string, repeatedly read and evaluate from it, returning the last values."
(defun call-with-temporary-file
(thunk &key
(want-stream-p t) (want-pathname-p t) (direction :io) keep after
directory prefix suffix (type ".tmp")
directory (type "tmp" typep) prefix (suffix (when typep "-tmp"))
(element-type *default-stream-element-type*)
(external-format *utf-8-external-format*))
"Call a THUNK with stream and/or pathname arguments identifying a temporary file.
The temporary file's pathname will be based on concatenating
PREFIX (defaults to \"uiop\"), a random alphanumeric string,
and optional SUFFIX and TYPE (defaults to \".tmp\"),
and optional SUFFIX (defaults to \"-tmp\" if a type was provided)
and TYPE (defaults to \"tmp\", using a dot as separator if not NIL),
within DIRECTORY (defaulting to the TEMPORARY-DIRECTORY) if the PREFIX isn't absolute.
The file will be open with specified DIRECTION (defaults to :IO),
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