guix: import texlive: Remove `files-differ?' function.

* guix/import/texlive.scm (files-differ?): Remove no longer used function.

Change-Id: I472b628da779c187fd315a929546c8e9bcefdcd3
This commit is contained in:
Nicolas Goaziou 2024-06-15 23:21:33 +02:00 committed by Ludovic Courtès
parent ae43ee7e09
commit 5cb3eaed15
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -37,8 +37,7 @@ (define-module (guix import texlive)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-2)
#:use-module (srfi srfi-26)
#:export (files-differ?
texlive->guix-package
#:export (texlive->guix-package
texlive-recursive-import))
;;; Commentary:
@ -346,44 +345,6 @@ (define (list-linked-scripts name package-database)
(reverse scripts)))
'()))
(define* (files-differ? directory package-name
#:key
(package-database tlpdb)
(type #false)
(direction 'missing))
"Return a list of files in DIRECTORY that differ from the expected installed
files for PACKAGE-NAME according to the PACKAGE-DATABASE. By default all
files considered, but this can be restricted by setting TYPE to 'runfiles,
'docfiles, or 'srcfiles. The names of files that are missing from DIRECTORY
are returned; by setting DIRECTION to anything other than 'missing, the names
of those files are returned that are unexpectedly installed."
(define (strip-directory-prefix file-name)
(string-drop file-name (1+ (string-length directory))))
(let* ((data (or (assoc-ref (package-database) package-name)
(error (format #false
"~a is not a valid package name in the TeX Live package database."
package-name))))
(files (if type
(or (assoc-ref data type) (list))
(append (or (assoc-ref data 'runfiles) (list))
(or (assoc-ref data 'docfiles) (list))
(or (assoc-ref data 'srcfiles) (list)))))
(existing (file-system-fold
(const #true) ;enter?
(lambda (path stat result) (cons path result)) ;leaf
(lambda (path stat result) result) ;down
(lambda (path stat result) result) ;up
(lambda (path stat result) result) ;skip
(lambda (path stat errno result) result) ;error
(list)
directory)))
(if (eq? direction 'missing)
(lset-difference string=?
files (map strip-directory-prefix existing))
;; List files that are installed but should not be.
(lset-difference string=?
(map strip-directory-prefix existing) files))))
(define (files->locations files)
(define (trim-filename entry)
(string-join (drop-right (string-split entry #\/) 1) "/" 'suffix))