man-db: Correctly resolve man page links.

Fixes <https://issues.guix.gnu.org/73259>.

Fixes a bug introduced in 8224555802
whereby a link such as “.so man1/bzdiff.1” would resolve to the file
that contains the link (in this case ‘bzcmp.1.zst’), as opposed to the
actual link target.  As a result, ‘man-page->entry’ would recurse,
reopening the man page that contains the link until file descriptor
exhaustion.

* guix/man-db.scm (mandb-entries): In second argument to
‘man-page->entry’, return either FILE-GZ or FILE-ZST, but not FILE.

Change-Id: I06a7a6905a98524efc889a18e81352bf9eec5743
This commit is contained in:
Ludovic Courtès 2024-09-30 11:18:03 +02:00
parent d057d59170
commit 210bbf9a39
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -223,7 +223,6 @@ (define (mandb-entries directory)
".gz")) ".gz"))
(file-zst (string-append directory "/" link (file-zst (string-append directory "/" link
".zst"))) ".zst")))
(and (or (file-exists? file-gz) (or (and (file-exists? file-gz) file-gz)
(file-exists? file-zst) file) (and (file-exists? file-zst) file-zst))))))
file)))))
(man-files directory))) (man-files directory)))