aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-02-24 10:08:58 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-02-24 10:09:03 -0700
commite1cd02dcf52fe9a2099748753c2948424d6a05f9 (patch)
tree71d45fa3ae75515d91b12a2a0fb0d5569b45ba9e
parentb07c6b345c0459f829a9792e49b321615c203c4e (diff)
downloadconsfigurator-e1cd02dcf52fe9a2099748753c2948424d6a05f9.tar.gz
use MRUN rather than RUN in some more places
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/connection/sudo.lisp4
-rw-r--r--src/data.lisp17
2 files changed, 11 insertions, 10 deletions
diff --git a/src/connection/sudo.lisp b/src/connection/sudo.lisp
index 2b61693..972c20f 100644
--- a/src/connection/sudo.lisp
+++ b/src/connection/sudo.lisp
@@ -103,9 +103,7 @@
input-stream)
(t
nil))))
- (multiple-value-bind (out err exit-code)
- (run :may-fail :input new-input (sudocmd c cmd))
- (values (strcat err out) exit-code))))
+ (mrun :may-fail :input new-input (sudocmd c cmd))))
(defmethod connection-readfile ((c sudo-connection) path)
(multiple-value-bind (out exit-code)
diff --git a/src/data.lisp b/src/data.lisp
index 5f9846c..9159332 100644
--- a/src/data.lisp
+++ b/src/data.lisp
@@ -293,7 +293,7 @@ appropriate. Falls back to CONNECTION-WRITEFILE."
(escape-sh-token source))
:output tmp)
(connection-try-upload tmp (unix-namestring dest))
- (run "gunzip" "--keep" dest)))
+ (mrun "gunzip" "--keep" dest)))
(connection-try-upload source *dest*))))
(defmethod connection-upload-data ((data string-data))
@@ -302,9 +302,9 @@ appropriate. Falls back to CONNECTION-WRITEFILE."
(defun connection-clear-data-cache (iden1 iden2)
(let ((dir (ensure-directory-pathname (remote-data-pathname iden1 iden2))))
- (run (strcat "rm -f "
- (unix-namestring (pathname-directory-pathname dir))
- "/*"))))
+ (mrun (strcat "rm -f "
+ (unix-namestring (pathname-directory-pathname dir))
+ "/*"))))
(defun get-local-data-cache-dir ()
(ensure-directory-pathname
@@ -330,7 +330,8 @@ process, where each entry is of the form
(defun get-remote-data-cache-dir ()
(ensure-directory-pathname
(car
- (runlines "echo ${XDG_CACHE_HOME:-$HOME/.cache}/consfigurator/data/"))))
+ (lines
+ (mrun "echo ${XDG_CACHE_HOME:-$HOME/.cache}/consfigurator/data/")))))
(defun get-remote-cached-prerequisite-data ()
"Return a list of items of prerequisite data in the cache on the remote side
@@ -339,8 +340,10 @@ of the current connection, where each entry is of the form
'(iden1 iden2 version)."
(mapcar (lambda (line)
(mapcar #'filename->string (split-string line :separator "/")))
- (runlines :may-fail "find" (get-remote-data-cache-dir)
- "-type" "f" "-printf" "%P\\n")))
+ (multiple-value-bind (out exit)
+ (mrun :may-fail "find" (get-remote-data-cache-dir)
+ "-type" "f" "-printf" "%P\\n")
+ (and (= 0 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