guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: guix: Fix sub-directories in texlive importer locations.


From: guix-commits
Subject: 01/04: guix: Fix sub-directories in texlive importer locations.
Date: Sat, 1 Jul 2023 16:40:59 -0400 (EDT)

ngz pushed a commit to branch tex-team-next
in repository guix.

commit 2dff6cf60efb81df12cd6f98c1cb672c16da8abf
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
AuthorDate: Sat Jul 1 21:40:42 2023 +0200

    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.
---
 guix/import/texlive.scm | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index 3b5c7192b1..8f90be0c7b 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -352,7 +352,8 @@ of those files are returned that are unexpectedly 
installed."
                          (map strip-directory-prefix existing) 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
   ;; name to make so as to extract only the files related to the package being
   ;; imported.
@@ -362,13 +363,10 @@ of those files are returned that are unexpectedly 
installed."
                                   texlive-generic-locations))
                            files)))
     (append generic
-            (map (cut string-join <> "/" 'suffix)
-                 (delete-duplicates (map (lambda (file)
-                                           (drop-right (name->parts file) 1))
-                                         (sort specific string<))
-                                    ;; Remove sub-directories, i.e. more
-                                    ;; specific entries with the same prefix.
-                                    (lambda (x y) (every equal? x y)))))))
+            ;; Remove sub-directories, i.e., more specific entries with the
+            ;; same prefix.
+            (delete-duplicates (sort (map trim-filename specific) string<)
+                               string-prefix?))))
 
 (define (tlpdb->package name version package-database)
   (and-let* ((data (assoc-ref package-database name))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]