guix-commits
[Top][All Lists]
Advanced

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

01/02: import: texlive: Remove more specific entries with the same prefi


From: guix-commits
Subject: 01/02: import: texlive: Remove more specific entries with the same prefix.
Date: Mon, 10 Jan 2022 07:11:07 -0500 (EST)

rekado pushed a commit to branch master
in repository guix.

commit 18bd4d12d70bae24b5a2f60bbb97cf1562f12a2c
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Mon Jan 10 12:40:18 2022 +0100

    import: texlive: Remove more specific entries with the same prefix.
    
    * guix/import/texlive.scm (files->directories): Ensure that any more 
specific
    directory is removed if a parent directory is in the list of provided
    locations.
---
 guix/import/texlive.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index bdef9f58b0..d5021669be 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2021 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2017, 2021, 2022 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -197,11 +197,14 @@
                      (loop all current #false))))))))))))
 
 (define (files->directories files)
+  (define name->parts (cut string-split <> #\/))
   (map (cut string-join <> "/" 'suffix)
        (delete-duplicates (map (lambda (file)
-                                 (drop-right (string-split file #\/) 1))
-                               files)
-                          equal?)))
+                                 (drop-right (name->parts file) 1))
+                               (sort files string<))
+                          ;; Remove sub-directories, i.e. more specific
+                          ;; entries with the same prefix.
+                          (lambda (x y) (every equal? x y)))))
 
 (define (tlpdb->package name package-database)
   (and-let* ((data (assoc-ref package-database name))



reply via email to

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