mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-22 18:26:43 +01:00
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.
This commit is contained in:
parent
fc91998274
commit
944ace7194
1 changed files with 6 additions and 8 deletions
|
@ -352,7 +352,8 @@ (define (strip-directory-prefix file-name)
|
|||
(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 @@ (define name->parts (cut string-split <> #\/))
|
|||
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))
|
||||
|
|
Loading…
Reference in a new issue