me
/
guix
Archived
1
0
Fork 0

guix: Fix sub-directories in texlive importer locations.

* guix/import/texlive.scm (files->locations): When removing a sub-directory,
make sure to actually remove the sub-directory and not the parent.
Nicolas Goaziou 2023-07-01 21:40:42 +02:00
parent fc91998274
commit 944ace7194
No known key found for this signature in database
GPG Key ID: DA00B4F048E92F2D
1 changed files with 6 additions and 8 deletions

View File

@ -352,7 +352,8 @@ of those files are returned that are unexpectedly installed."
(map strip-directory-prefix existing) files)))) (map strip-directory-prefix existing) files))))
(define (files->locations files) (define (files->locations files)
(define name->parts (cut string-split <> #\/)) (define (trim-filename entry)
(string-join (drop-right (string-split entry #\/) 1) "/" 'suffix))
;; Generic locations are shared by multiple packages. Provide the full file ;; Generic locations are shared by multiple packages. Provide the full file
;; name to make so as to extract only the files related to the package being ;; name to make so as to extract only the files related to the package being
;; imported. ;; imported.
@ -362,13 +363,10 @@ of those files are returned that are unexpectedly installed."
texlive-generic-locations)) texlive-generic-locations))
files))) files)))
(append generic (append generic
(map (cut string-join <> "/" 'suffix) ;; Remove sub-directories, i.e., more specific entries with the
(delete-duplicates (map (lambda (file) ;; same prefix.
(drop-right (name->parts file) 1)) (delete-duplicates (sort (map trim-filename specific) string<)
(sort specific string<)) string-prefix?))))
;; Remove sub-directories, i.e. more
;; specific entries with the same prefix.
(lambda (x y) (every equal? x y)))))))
(define (tlpdb->package name version package-database) (define (tlpdb->package name version package-database)
(and-let* ((data (assoc-ref package-database name)) (and-let* ((data (assoc-ref package-database name))