;; A simple script that adds each file given from the command-line into the ;; store and checks them if it's the same. (use-modules (guix) (srfi srfi-1) (ice-9 ftw) (rnrs io ports)) ;; This is based from tests/derivations.scm from Guix source code. (define* (directory-contents dir #:optional (slurp get-bytevector-all)) "Return an alist representing the contents of DIR" (define prefix-len (string-length dir)) (sort (file-system-fold (const #t) (lambda (path stat result) (alist-cons (string-drop path prefix-len) (call-with-input-file path slurp) result)) (lambda (path stat result) result) (lambda (path stat result) result) (lambda (path stat result) result) (lambda (path stat errno result) result) '() dir) (lambda (e1 e2) (string