From 23497607bf7ec831dd57bf06bf6cd802c3ec6b8a Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 16 Mar 2023 12:00:35 -0700 Subject: new reader macros for shell- and Perl-style matching & replacement Signed-off-by: Sean Whitton --- src/property/cron.lisp | 2 +- src/property/crypttab.lisp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/property') diff --git a/src/property/cron.lisp b/src/property/cron.lisp index bba953f..e68b6ca 100644 --- a/src/property/cron.lisp +++ b/src/property/cron.lisp @@ -135,7 +135,7 @@ directory." (old (runlines :may-fail "crontab" "-l")) (new (mapcar - (lambda (line) (re:regex-replace-all #?/\$HOME/ line home)) + #~s/\$HOME/${home}/g (nconc (list "# Automatically updated by Consfigurator; do not edit" "") (loop for (k v) on env by #'cddr diff --git a/src/property/crypttab.lisp b/src/property/crypttab.lisp index cc44f50..6538409 100644 --- a/src/property/crypttab.lisp +++ b/src/property/crypttab.lisp @@ -25,10 +25,9 @@ (if (string= val "") nil val))) (defun get-device-parent (device) - (multiple-value-bind (match groups) - (re:scan-to-strings #?/^1\s+dependencies\s*:\s*\((\S+)\)$/ - (run "dmsetup" "deps" "-o" "blkdevname" device)) - (and match (merge-pathnames (elt groups 0) #P"/dev/")))) + (aand (#1~/^1\s+dependencies\s*:\s*\((\S+)\)$/ + (run "dmsetup" "deps" "-o" "blkdevname" device)) + (merge-pathnames it #P"/dev/"))) (defmethod ct-target ((volume opened-luks-container)) (volume-label volume)) -- cgit v1.2.3