diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-05 16:29:46 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-10 20:45:21 -0700 |
commit | 56bc5a2c24b0fe56c72ced9a5ac85d982d592567 (patch) | |
tree | d01d1820afeadd4d50794e45007bba9d9533b373 /src/connection/sbcl.lisp | |
parent | ec508517bc89d3934afa9ec91f3787839b14be2d (diff) | |
download | consfigurator-56bc5a2c24b0fe56c72ced9a5ac85d982d592567.tar.gz |
signal SKIPPED-PROPERTIES & factor out interpreting exit codes
Unconditionally signalling FAILED-CHANGE does not make sense because perhaps
the type of condition C is not a subtype of SIMPLE-CONDITION. Moreover, when
we invoke the SKIP-PROPERTY restart we do not actually pass the condition.
For simplicity, and since all we need is notification that a SKIP-PROPERTY
restart was invoked, instead define and signal a special-purpose condition.
Additionally, use an exit code to pass the signal between Lisp images.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection/sbcl.lisp')
-rw-r--r-- | src/connection/sbcl.lisp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/connection/sbcl.lisp b/src/connection/sbcl.lisp index fb862aa..ed68243 100644 --- a/src/connection/sbcl.lisp +++ b/src/connection/sbcl.lisp @@ -56,13 +56,14 @@ recommended.")) (multiple-value-bind (program forms) (continue-deploy*-program remaining requirements) (multiple-value-bind (out err exit) (run :may-fail :input program *sbcl*) - (inform t (if (< exit 2) "done." "failed.") :fresh-line nil) + (inform t (if (< exit 3) "done." "failed.") :fresh-line nil) (when-let ((lines (lines out))) (inform t " Output was:" :fresh-line nil) (with-indented-inform (inform t lines))) - (unless (< exit 2) - ;; print FORMS not PROGRAM because latter might contain sudo passwords - (failed-change - "~&Remote Lisp failed; stderr was:~%~%~A~&~%Program we sent:~%~%~S" - err forms)) - (values nil (if (zerop exit) :no-change nil)))))) + (return-exit + exit + ;; print FORMS not PROGRAM because latter might contain sudo passwords + :on-failure + (failed-change + "~&Remote Lisp failed; stderr was:~%~%~A~&~%Program we sent:~%~%~S" + err forms)))))) |