unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] profiles: Generate database file for manpages
Date: Tue, 04 Apr 2017 07:20:34 -0700	[thread overview]
Message-ID: <87wpb02r0t.fsf@gmail.com> (raw)
In-Reply-To: <87efx8s6dq.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 04 Apr 2017 14:29:37 +0200")


[-- Attachment #1.1: Type: text/plain, Size: 2024 bytes --]

Hi Ludovic,

ludo@gnu.org (Ludovic Courtès) writes:

> Hi Maxim,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Type: text/x-patch, Size: 1282 bytes --]

@@ -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

[-- Attachment #1.3: Type: text/plain, Size: 40 bytes --]


I think we're closing in... :)

Maxim


[-- Attachment #1.4: ~/src/guix/0001-profiles-Generate-database-file-for-manpages.patch --]
[-- Type: message/external-body, Size: 102 bytes --]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2017-04-04 14:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30  8:35 [PATCH] profiles: Generate database file for manpages Maxim Cournoyer
2017-03-30 15:53 ` Ludovic Courtès
2017-03-31  7:12   ` Maxim Cournoyer
2017-03-31 22:44     ` Ludovic Courtès
2017-04-03 15:29       ` Maxim Cournoyer
2017-04-04 12:29         ` Ludovic Courtès
2017-04-04 14:20           ` Maxim Cournoyer [this message]
2017-04-05  0:59             ` Maxim Cournoyer
2017-04-05  7:45               ` Ludovic Courtès
2017-04-05  7:47             ` Ludovic Courtès
2017-04-05  8:09               ` Maxim Cournoyer
2017-04-05 21:00                 ` Ludovic Courtès
2017-04-06  6:32                   ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wpb02r0t.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).