Hi Ludovic! Sorry I couldn't reply before! ludo@gnu.org (Ludovic Courtès) writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> Unfortunately some of the simplifications you made appear to break it >> :). I've tried your reworked patch and got the same result as you (no >> result found except when using man -K). When I use the original patch it >> works as I originally described. > > Oops. > >>> + (define (populate-manpages-collection-dir entries) >>> + (let ((manpages (append-map find-files entries))) >>> + (for-each (lambda (manpage) >>> + (let* ((dest-file (string-append >>> + manpages-collection-dir "/" >>> + (strip-store-file-name manpage)))) >> >> Unfortunately we cannot simply use strip-store-file-name, since what >> mandb expects to find in our manpages-collection-dir is a collection of >> subdirectories such as man1, man3, man7, etc. such as would be found >> under "/usr/share/man" on a traditional distro. This change instead >> makes it look like: >> >> bazaar-2.7.0/ gdbm-1.12/ libxau-1.0.8/ ... >> >> I guess this is what broke it. > > Oh, got it. > > However, with this version of the patch, I get: > > ?: 0 [+ #f 11] > > ERROR: In procedure +: > ERROR: In procedure +: Wrong type argument in position 1: #f > builder for `/gnu/store/y754cn7f468yc1b0pc13cxk99fmnwwx1-manual-database.drv' failed with exit code 1 > > which I think is because (string-contains manpage-path "/share/man/") > returns #f. > > Could you look into it? > > (BTW, I find it slightly clearer to use ‘string-drop’ etc. instead of > ‘substring’.) > Done. > Other than that it should be fine. Unfortunately I cannot reproduce the problem on my side, although you seem to be right that this is caused by the `string-contains` not matching "/share/man/" in the manpage-path and returning #f... The only reason I'd suspect this could happen was if the `find-files` method (used io list all the files contained under "$manifest-inputs/share/man/") somehow returned bogus paths (I saw that this function has a "fail-on-error?" argument which is disabled by default). To help further troubleshoot this, could you please use the provided patch instead, where I inserted: (define (get-manpage-tail-path manpage-path) (let ((index (string-contains manpage-path "/share/man/"))) + (unless index + (error "Manual path doesn't contain \"/share/man/\":" + manpage-path)) (substring manpage-path (+ index (string-length "/share/man/"))))) (define (populate-manpages-collection-dir entries) to print the unexpectedly formed manpage-path. Thanks! I hope we can sort this out. Maxim