From 10efffee1ae1258ca4c19bac5ed12adebd015b14 Mon Sep 17 00:00:00 2001
From: Francois-Rene Rideau <tunes@google.com>
Date: Thu, 31 May 2012 01:09:16 -0400
Subject: [PATCH] Improve error behavior. Support clozure for mkdir and setenv
 (need to be moved away).

---
 run.lisp       | 2 +-
 utilities.lisp | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/run.lisp b/run.lisp
index b828006..efc92de 100644
--- a/run.lisp
+++ b/run.lisp
@@ -64,7 +64,7 @@
     (function
      (apply 'run-process-spec (funcall host spec) :host nil keys))))
 
-(defun run (cmd &key on-error time (output t) show host)
+(defun run (cmd &key time (output t) show host (on-error (list "Command ~S failed~@[ on ~A~]" cmd host)))
   (labels ((process-time ()
              (if time (time (process-command)) (process-command)))
            (process-command ()
diff --git a/utilities.lisp b/utilities.lisp
index 980ae77..54cd7f4 100644
--- a/utilities.lisp
+++ b/utilities.lisp
@@ -5,12 +5,16 @@
 ;;--- TODO: move these to FARE-UTILS and/or XCVB-DRIVER ?
 
 (defun make-directory (dir &optional (mode #o755))
+  ;; TODO: move to fare-utils or somewhere else
+  ;; TODO: it's low-level. rename this mkdir or some such, and document use of native-namestring.
+  #+clozure (ccl::%mkdir dir mode)
   #+sbcl (sb-posix:mkdir dir mode)
-  #-sbcl (NIY 'make-directory))
+  #-(or clozure sbcl) (NIY 'make-directory))
 
 (defun setenv (var val &optional (overwritep t))
+  #+clozure (ccl:setenv var val overwritep)
   #+sbcl (sb-posix:setenv var val (if overwritep 1 0))
-  #-sbcl (NIY 'setenv))
+  #-(or clozure sbcl) (NIY 'setenv))
 
 (defmacro pipe (values &rest transformers)
   (if (null transformers)
-- 
GitLab