guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] profiles: Generate database file for manpages


From: Ludovic Courtès
Subject: Re: [PATCH] profiles: Generate database file for manpages
Date: Wed, 05 Apr 2017 09:47:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hi Maxim,

Maxim Cournoyer <address@hidden> skribis:

> address@hidden (Ludovic Courtès) writes:
>
>> Hi Maxim,
>>
>> Maxim Cournoyer <address@hidden> skribis:
>>
>>> 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.
>>
>> The problem happens with 
>> "/gnu/store/rn3vri602z3jpwqnha0r5nwxi6v0qpnx-texlive-2016/share/man" (no
>> trailing slash):
>>
>> $ ls -l "/gnu/store/rn3vri602z3jpwqnha0r5nwxi6v0qpnx-texlive-2016/share/man"
>> lrwxrwxrwx 2 root root 70 Jan  1  1970 
>> /gnu/store/rn3vri602z3jpwqnha0r5nwxi6v0qpnx-texlive-2016/share/man -> 
>> /gnu/store/8mhqravbd3pv7x1y2qfjlv0bdjchszn0-texlive-bin-2016/share/man
>>
>> ‘find-files’ uses ‘lstat’ by default, which means it does not follow
>> symlinks, and I guess that’s what’s happening here.  Perhaps
>> ‘find-files’ needs to be called with #:stat stat to use ‘stat’ instead
>> of ‘lstat’?
>>
>> Thanks,
>> Ludo’.
>
> That's a good idea! Could you please try again with the new included
> patch? Here are the latest changes:
>
> @@ -954,7 +954,8 @@ files for the fonts of the @var{manifest} entries."
>    (define build
>      #~(begin
>          (use-modules (guix build utils)
> -                     (srfi srfi-1))
> +                     (srfi srfi-1)
> +                     (srfi srfi-26))
>  
>          (define entries
>            (filter-map (lambda (directory)
> @@ -977,7 +978,7 @@ files for the fonts of the @var{manifest} entries."
>              (string-drop manpage-path (+ index (string-length 
> "/share/man/")))))
>  
>          (define (populate-manpages-collection-dir entries)
> -          (let ((manpages (append-map find-files entries)))
> +          (let ((manpages (append-map (cut find-files <> #:stat stat) 
> entries)))
>              (for-each (lambda (manpage)
>                          (let* ((dest-file (string-append
>                                             manpages-collection-dir "/"
> @@ -1012,7 +1013,8 @@ files for the fonts of the @var{manifest} entries."
>                          "-C" "man_db.conf"))))
>  
>    (gexp->derivation "manual-database" build
> -                    #:modules '((guix build utils))
> +                    #:modules '((guix build utils)
> +                                (srfi srfi-26))
>                      #:local-build? #t))
>  
>  (define %default-profile-hooks
>
>
> I think we're closing in... :)
>
> Maxim

The attachment is missing from your message (it’s marked as
“message/external-body”, which AIUI means that it would just look for a
same-named file on the recipient’s machine.)  Could you resend it?  :-)

Thanks,
Ludo’.



reply via email to

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