diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-02-27 14:58:34 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-02-27 14:58:34 -0700 |
commit | 60d708c289a4ad547bc58e6cf33c2b8bb53b2da4 (patch) | |
tree | 5a0cb61faeac844e9fa0e7b7ee7ce383a7f54b8a | |
parent | 15ef751ac3f587a28baca862bd05305646bacb3b (diff) | |
download | consfigurator-60d708c289a4ad547bc58e6cf33c2b8bb53b2da4.tar.gz |
use ZEROP
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/connection.lisp | 2 | ||||
-rw-r--r-- | src/connection/debian-sbcl.lisp | 2 | ||||
-rw-r--r-- | src/connection/shell-wrap.lisp | 2 | ||||
-rw-r--r-- | src/data.lisp | 2 | ||||
-rw-r--r-- | src/util.lisp | 18 |
5 files changed, 13 insertions, 13 deletions
diff --git a/src/connection.lisp b/src/connection.lisp index 4e0863f..b6a23fa 100644 --- a/src/connection.lisp +++ b/src/connection.lisp @@ -260,7 +260,7 @@ start with RUN." (lines (apply #'run args))) (defun test (&rest args) - (= 0 (apply #'run :for-exit "test" args))) + (zerop (apply #'run :for-exit "test" args))) (defun readfile (&rest args) (apply #'connection-readfile *connection* args)) diff --git a/src/connection/debian-sbcl.lisp b/src/connection/debian-sbcl.lisp index 52b1f36..5965853 100644 --- a/src/connection/debian-sbcl.lisp +++ b/src/connection/debian-sbcl.lisp @@ -30,7 +30,7 @@ "--disable-debugger" "--no-sysinit" "--no-user-init") (format t "done.") - (if (= 0 exit) + (if (zerop exit) (format t " Output was:~%~{ ~A~%~}" (lines out)) (error "~%~%Remote Lisp failed; we sent~%~%~A~%~%and stderr was:~%~A" program err)))) diff --git a/src/connection/shell-wrap.lisp b/src/connection/shell-wrap.lisp index 9619cc1..5f94302 100644 --- a/src/connection/shell-wrap.lisp +++ b/src/connection/shell-wrap.lisp @@ -29,7 +29,7 @@ (multiple-value-bind (out exit) (let ((path (escape-sh-token path))) (connection-run c #?"test -r ${path} && cat ${path}" nil)) - (if (= 0 exit) out (error "File ~S not readable" path)))) + (if (zerop exit) out (error "File ~S not readable" path)))) (defmethod connection-writefile ((conn shell-wrap-connection) path diff --git a/src/data.lisp b/src/data.lisp index cd840a7..3ed4069 100644 --- a/src/data.lisp +++ b/src/data.lisp @@ -345,7 +345,7 @@ of the current connection, where each entry is of the form (multiple-value-bind (out exit) (mrun :may-fail "find" (get-remote-data-cache-dir) "-type" "f" "-printf" "%P\\n") - (and (= 0 exit) (lines out))))) + (and (zerop exit) (lines out))))) ;; TODO on remote side, catch read errors and signal our own which says ;; something more specific -- "This has probably been caused by an attempt to diff --git a/src/util.lisp b/src/util.lisp index 64d049f..ef82584 100644 --- a/src/util.lisp +++ b/src/util.lisp @@ -53,15 +53,15 @@ (dpkg-version-compare x ">=" y)) (defun dpkg-version-compare (x r y) - (= 0 (nth-value 2 (run-program `("dpkg" "--compare-versions" - ,(etypecase x - (string x) - (number (format nil "~A" x))) - ,r - ,(etypecase y - (string y) - (number (format nil "~A" y)))) - :ignore-error-status t)))) + (zerop (nth-value 2 (run-program `("dpkg" "--compare-versions" + ,(etypecase x + (string x) + (number (format nil "~A" x))) + ,r + ,(etypecase y + (string y) + (number (format nil "~A" y)))) + :ignore-error-status t)))) ;;;; Encoding of strings to filenames |