From ed8c76f566de8f6c10cdace515b3d076026258f0 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 1 Apr 2022 18:09:50 -0700 Subject: replace some Scheme-style names Signed-off-by: Sean Whitton --- src/data.lisp | 6 +++--- src/package.lisp | 10 +++++----- src/property/apt.lisp | 2 +- src/property/chroot.lisp | 2 +- src/property/cron.lisp | 4 ++-- src/property/crypttab.lisp | 4 ++-- src/property/fstab.lisp | 6 +++--- src/property/network.lisp | 4 ++-- src/property/periodic.lisp | 2 +- src/util.lisp | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/data.lisp b/src/data.lisp index ac5c6e9..492c886 100644 --- a/src/data.lisp +++ b/src/data.lisp @@ -383,7 +383,7 @@ CONTINUE-DEPLOY* or CONTINUE-DEPLOY*-PROGRAM." (defun data-pathname (root &rest segments) (destructuring-bind (last . rest) - (nreverse (mapcar #'string->filename segments)) + (nreverse (mapcar #'string-to-filename segments)) (merge-pathnames last (reduce #'merge-pathnames (mapcar (lambda (s) (strcat s "/")) rest) :from-end t :initial-value root)))) @@ -420,7 +420,7 @@ of CONNECTION, where each entry is of the form (defmethod get-remote-cached-prerequisite-data ((connection connection)) (let ((*connection* connection)) (mapcar (lambda (line) - (mapcar #'filename->string (split-string line :separator "/"))) + (mapcar #'filename-to-string (split-string line :separator "/"))) (multiple-value-bind (out exit) (mrun :may-fail "find" (merge-pathnames "data/" @@ -444,7 +444,7 @@ always supply a value for WHERE." nconc (loop for subdir in (subdirectories dir) nconc (loop for file in (directory-files subdir) collect - (mapcar #'filename->string + (mapcar #'filename-to-string (list (lastcar (pathname-directory dir)) (lastcar diff --git a/src/package.lisp b/src/package.lisp index 9a8b9b4..d8c0c2f 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -107,7 +107,7 @@ #:unwords #:memstr= #:define-simple-error - #:plist->long-options + #:plist-to-long-options #:systemd--user #:with-local-temporary-directory #:pathname-file @@ -134,8 +134,8 @@ #:version<= #:version>= - #:string->filename - #:filename->string + #:string-to-filename + #:filename-to-string #:return-exit #:posix-login-environment @@ -638,7 +638,7 @@ (:use #:consfigurator.property.disk) (:local-nicknames (#:os #:consfigurator.property.os) (#:file #:consfigurator.property.file)) - (:export #:volume->entry + (:export #:volume-to-entry #:has-entries #:has-entries-for-volumes #:has-entries-for-opened-volumes)) @@ -648,7 +648,7 @@ (:local-nicknames (#:re #:cl-ppcre) (#:os #:consfigurator.property.os) (#:file #:consfigurator.property.file)) - (:export #:volume->entry + (:export #:volume-to-entry #:has-entries-for-opened-volumes)) (package :consfigurator.property.gnupg diff --git a/src/property/apt.lisp b/src/property/apt.lisp index 41ec98d..d1bf892 100644 --- a/src/property/apt.lisp +++ b/src/property/apt.lisp @@ -367,7 +367,7 @@ in testing, you could use: collect (list 'file:exists-with-content (strcat "/etc/apt/preferences.d/10consfig_" - (string->filename preference) + (string-to-filename preference) ".pref") (nbutlast (loop for (os pin) on pairs by #'cddr diff --git a/src/property/chroot.lisp b/src/property/chroot.lisp index 805f676..e894a9f 100644 --- a/src/property/chroot.lisp +++ b/src/property/chroot.lisp @@ -34,7 +34,7 @@ &allow-other-keys &aux (os (get-hostattrs-car :os host)) (args (list "debootstrap" - (plist->long-options + (plist-to-long-options (remove-from-plist options :apt.proxy :apt.mirror)) (strcat "--arch=" (os:debian-architecture os)) (os:debian-suite os) diff --git a/src/property/cron.lisp b/src/property/cron.lisp index 959f190..f5dc67e 100644 --- a/src/property/cron.lisp +++ b/src/property/cron.lisp @@ -38,8 +38,8 @@ The output of the cronjob will be mailed only if the job exits nonzero." (strcat "/etc/cron." (if (keywordp when) (string-downcase (symbol-name when)) "d")))) - (job (merge-pathnames (string->filename desc) dir)) - (script (merge-pathnames (strcat (string->filename desc) "_cronjob") + (job (merge-pathnames (string-to-filename desc) dir)) + (script (merge-pathnames (strcat (string-to-filename desc) "_cronjob") #P"/usr/local/bin/")) (script* (sh-escape script))) `(with-unapply diff --git a/src/property/crypttab.lisp b/src/property/crypttab.lisp index 744361b..4229cbf 100644 --- a/src/property/crypttab.lisp +++ b/src/property/crypttab.lisp @@ -54,7 +54,7 @@ (defmethod ct-options ((volume opened-luks-container)) (or (crypttab-options volume) '("none"))) -(defmethod volume->entry ((volume opened-luks-container)) +(defmethod volume-to-entry ((volume opened-luks-container)) (format nil "~A ~A ~A ~{~A~^,~}" (ct-target volume) (ct-source volume) (ct-keyfile volume) (ct-options volume))) @@ -82,6 +82,6 @@ This is used when building disk images and installing operating systems." (:hostattrs (os:required 'os:linux)) (:apply (apply #'has-entries - (mapcar #'volume->entry + (mapcar #'volume-to-entry (mapcan (curry #'subvolumes-of-type 'opened-luks-container) (get-connattr :opened-volumes)))))) diff --git a/src/property/fstab.lisp b/src/property/fstab.lisp index f684316..34f1d04 100644 --- a/src/property/fstab.lisp +++ b/src/property/fstab.lisp @@ -67,7 +67,7 @@ Other properties might fill it in." (if (eql #P"/" (mount-point volume)) 1 2)) -(defmethod volume->entry ((volume filesystem) parent) +(defmethod volume-to-entry ((volume filesystem) parent) (format nil "~A ~A ~A ~{~A~^,~} ~A ~A" (fs-spec volume parent) (fs-file volume) (fs-vfstype volume) (fs-mntops volume) @@ -95,7 +95,7 @@ specified with DISK:HAS-VOLUMES." (:desc (format nil "fstab entries for ~:[~;host's ~]volumes" volumes)) (:hostattrs (os:required 'os:linux)) (:apply (apply #'has-entries - (apply #'mapcar #'volume->entry + (apply #'mapcar #'volume-to-entry (multiple-value-list (multiple-value-mapcan (curry #'subvolumes-of-type 'filesystem) @@ -109,7 +109,7 @@ This is used when building disk images and installing operating systems." (:hostattrs (os:required 'os:linux)) (:apply (apply #'has-entries - (apply #'mapcar #'volume->entry + (apply #'mapcar #'volume-to-entry (multiple-value-list (multiple-value-mapcan (curry #'subvolumes-of-type 'mounted-filesystem) diff --git a/src/property/network.lisp b/src/property/network.lisp index 4ac849a..c802c90 100644 --- a/src/property/network.lisp +++ b/src/property/network.lisp @@ -75,7 +75,7 @@ OPTIONS is a list of even length of alternating keys and values." (setq options (list* "netmask" netmask options))) (setq options (list* "address" address options)) (file:has-content - (merge-pathnames (string->filename interface) + (merge-pathnames (string-to-filename interface) #P"/etc/network/interfaces.d/") (list* (strcat "auto " interface) (format nil "iface ~A ~A static" @@ -103,7 +103,7 @@ the networking stack's current state like this one does." return (words line))) (interface (or interface (fifth default))) (gateway (and (string= (fifth default) interface) (third default))) - (file (merge-pathnames (string->filename interface) + (file (merge-pathnames (string-to-filename interface) #P"/etc/network/interfaces.d/"))) (if (remote-exists-p file) :no-change diff --git a/src/property/periodic.lisp b/src/property/periodic.lisp index 437ed41..4a75182 100644 --- a/src/property/periodic.lisp +++ b/src/property/periodic.lisp @@ -41,7 +41,7 @@ user." (define-function-property-combinator at-most* (period desc propapp) (symbol-macrolet ((flagfile (merge-pathnames - (string->filename desc) + (string-to-filename desc) (merge-pathnames "at-most/" (get-connattr :consfigurator-cache))))) (destructuring-bind (psym . args) propapp diff --git a/src/util.lisp b/src/util.lisp index d1658d3..f480df6 100644 --- a/src/util.lisp +++ b/src/util.lisp @@ -160,7 +160,7 @@ supported." do (pop forms) finally (return forms))) -(defun plist->long-options (plist &aux args) +(defun plist-to-long-options (plist &aux args) (doplist (k v plist args) (push (strcat "--" (string-downcase (symbol-name k)) "=" v) args))) @@ -509,7 +509,7 @@ previous output." ;; This implementation also assumes that the Lisp doing the decoding has the ;; same charset as the Lisp doing the encoding. -(defun string->filename (s) +(defun string-to-filename (s) (apply #'concatenate 'string (loop for c across (etypecase s (string s) (number (write-to-string s))) @@ -520,7 +520,7 @@ previous output." else collect (format nil "_~X_" (char-code c))))) -(defun filename->string (s) +(defun filename-to-string (s) (loop with decoding with buffer with result -- cgit v1.2.3