From e3e2576546f8d00f6d430751aaadb0a16cdda4c3 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Tue, 1 Jun 2021 10:02:48 +0200 Subject: [PATCH] ambrevar: Add find-missing-files. --- .local/share/common-lisp/source/ambrevar/shell.lisp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.local/share/common-lisp/source/ambrevar/shell.lisp b/.local/share/common-lisp/source/ambrevar/shell.lisp index bdb37af7..dfece85f 100644 --- a/.local/share/common-lisp/source/ambrevar/shell.lisp +++ b/.local/share/common-lisp/source/ambrevar/shell.lisp @@ -399,3 +399,13 @@ INTERFACE is a string in the form of `wlp2s0'." "sudo sh -c 'echo 1 > /sys/module/snd_hda_intel/parameters/power_save'"))) (enable-audio-codec-power-management) (bbswitch-off))) + +(export-always 'find-missing-files) +(defun find-missing-files (source target) + "Report files from SOURCE that are not in TARGET. +Files are compared by size." + (let ((source-files (uiop:with-current-directory (source) + (fof:finder))) + (target-files (uiop:with-current-directory (target) + (fof:finder)))) + (set-difference source-files target-files :key #'fof:size)))