From b9cf8fa7dabb2f47ad38541316ccc373359838ee Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 16 Sep 2021 18:23:16 -0700 Subject: factor out REMOTE-EXECUTABLE-FIND Signed-off-by: Sean Whitton --- src/connection.lisp | 3 +++ src/package.lisp | 1 + src/property/chroot.lisp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/connection.lisp b/src/connection.lisp index 0e80fff..8cd3a00 100644 --- a/src/connection.lisp +++ b/src/connection.lisp @@ -601,6 +601,9 @@ specification of POSIX ls(1))." (merge-pathnames path (merge-pathnames "consfigurator/" (get-connattr :XDG-CACHE-HOME)))) +(defun remote-executable-find (executable) + (zerop (mrun :for-exit "command" "-v" executable))) + (defun readfile (path) (connection-readfile *connection* diff --git a/src/package.lisp b/src/package.lisp index a779fca..a32c21f 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -159,6 +159,7 @@ #:remote-file-stats #:remote-last-reboot #:remote-consfigurator-cache-pathname + #:remote-executable-find #:mountpointp #:delete-remote-trees #:empty-remote-directory diff --git a/src/property/chroot.lisp b/src/property/chroot.lisp index ecf7698..3cfe527 100644 --- a/src/property/chroot.lisp +++ b/src/property/chroot.lisp @@ -54,7 +54,7 @@ (apply #'run args)))) (defprop %debootstrap-manually-installed :posix () - (:check (zerop (mrun :for-exit "command" "-v" "debootstrap"))) + (:check (remote-executable-find "debootstrap")) (:apply (failed-change "Don't know how to install debootstrap(8) manually."))) -- cgit v1.2.3