aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/property.lisp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/property.lisp b/src/property.lisp
index 332ef2c..1bba39e 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -571,11 +571,14 @@ PATH already has the specified CONTENT and MODE."
;; this is a safe parse of ls(1) output given its POSIX specification
(defun ls-cksum (file)
- (let ((ls (ignore-errors
- (words (run :env '(:LC_ALL "C") "ls" "-dlL" file))))
- (cksum (ignore-errors (cksum file))))
- (when (and ls cksum)
- (list* (car ls) cksum (subseq ls 2 8)))))
+ (when-let* ((ls (ignore-errors
+ (words (run :env '(:LC_ALL "C") "ls" "-dlL" file))))
+ (ls-car (car ls))
+ (ls-end (subseq ls 2 8)))
+ (if (char= #\d (elt ls-car 0))
+ (cons ls-car ls-end)
+ (let ((cksum (ignore-errors (cksum file))))
+ (and cksum (list* ls-car cksum ls-end))))))
(defmacro with-change-if-changes-file ((file) &body forms)
"Execute FORMS and yield :NO-CHANGE if FILE does not change.