aboutsummaryrefslogtreecommitdiff
path: root/src/connection.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-03-11 15:27:00 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-03-11 16:40:08 -0700
commit4e0a4c107e4a2ee708e6e7a9f3edf189fe858f14 (patch)
treeb8e51af43f895a98ebd943580c51c1da38151bdf /src/connection.lisp
parentf2ba47b7ef017a01a4b6c13982ff43a67cc6abd5 (diff)
downloadconsfigurator-4e0a4c107e4a2ee708e6e7a9f3edf189fe858f14.tar.gz
replace ESCAPE-SH-TOKEN and ESCAPE-SH-COMMAND with new SH-ESCAPE
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection.lisp')
-rw-r--r--src/connection.lisp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/connection.lisp b/src/connection.lisp
index d5d1618..a6c9fdc 100644
--- a/src/connection.lisp
+++ b/src/connection.lisp
@@ -121,7 +121,7 @@ time savings add up."))
(defmethod connection-readfile-and-remove ((connection connection) path)
(prog1 (connection-readfile connection path)
- (connection-run connection (strcat "rm " (escape-sh-token path)) nil)))
+ (connection-run connection (strcat "rm " (sh-escape path)) nil)))
;; only functional difference between WRITEFILE and UPLOAD is what args they
;; take: a string vs. a path. for a given connection type, they may have same
@@ -296,7 +296,7 @@ which will be cleaned up when BODY is finished."
:connection ,connection)))
(unwind-protect (progn ,@body)
(connection-run ,connection
- (format nil "rm -f ~A" (escape-sh-token ,file))
+ (format nil "rm -f ~A" (sh-escape ,file))
nil)))))
(defun mkstemp-cmd (&optional template
@@ -394,12 +394,12 @@ the working directory of the Lisp process using UIOP:WITH-CURRENT-DIRECTORY."
(ensure-list arg))))
while args
finally (nreversef cmd))
- (setq cmd (if (cdr cmd) (escape-sh-command cmd) (car cmd)))
+ (setq cmd (if (cdr cmd) (sh-escape cmd) (car cmd)))
(loop while env
for k = (string-upcase (symbol-name (pop env)))
for v = (pop env)
if v
- collect (format nil "export ~A=~A" k (escape-sh-token v))
+ collect (format nil "export ~A=~A" k (sh-escape v))
into accum
else
collect (format nil "unset -v ~A" k) into accum
@@ -422,10 +422,10 @@ the working directory of the Lisp process using UIOP:WITH-CURRENT-DIRECTORY."
;; simplicity, particularly to avoid having to check whether the connattr
;; is set yet, because setting it requires working CONNECTION-RUN.
(setq cmd (format nil "export HOME=~A; cd ~A; ~A"
- (escape-sh-token (drop-trailing-slash
- (unix-namestring
- (get-connattr :remote-home))))
- (escape-sh-token (unix-namestring (pwd)))
+ (sh-escape (drop-trailing-slash
+ (unix-namestring
+ (get-connattr :remote-home))))
+ (sh-escape (pwd))
cmd))
,@forms))
@@ -472,7 +472,7 @@ case return only the exit code."
(when stdout
(connection-run
*connection*
- (format nil "rm -f ~A" (escape-sh-token stdout))
+ (format nil "rm -f ~A" (sh-escape stdout))
nil)))))
(informat 4 "~&RUN ~A"
(if (> *consfigurator-debug-level* 4) wrapped cmd))
@@ -537,7 +537,7 @@ subclass to the :HOSTATTRS subroutine of properties calling this."
(defun empty-remote-directory (directory)
"Recursively delete the contents of DIRECTORY, but not DIRECTORY itself."
- (alet (escape-sh-token (drop-trailing-slash (unix-namestring directory)))
+ (alet (sh-escape (drop-trailing-slash (unix-namestring directory)))
(mrun (format nil "rm -rf -- ~A/* ~A/.[!.]* ~A/..?*" it it it))))
(defun remote-exists-p (&rest paths)
@@ -649,7 +649,7 @@ specification of POSIX ls(1))."
(uid (elt groups 3))
(gid (elt groups 4)))
(connection-writefile *connection* namestring content mode)
- (let ((namestring (escape-sh-token namestring)))
+ (let ((namestring (sh-escape namestring)))
(unless mode-supplied-p
;; assume that if we can write it we can chmod it
(mrun #?"chmod u=${umode},g=${gmode},o=${omode} ${namestring}"))