From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] profiles: Generate database file for manpages Date: Wed, 05 Apr 2017 09:47:01 +0200 Message-ID: <87lgrfmh3e.fsf@gnu.org> References: <87fuhvw4a8.fsf@gmail.com> <87a882wykx.fsf@gnu.org> <87tw69538i.fsf@gmail.com> <8737dtjcbh.fsf@gnu.org> <8760il4iie.fsf@gmail.com> <87efx8s6dq.fsf@gnu.org> <87wpb02r0t.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvfen-0006b3-5V for guix-devel@gnu.org; Wed, 05 Apr 2017 03:47:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvfej-00059i-9Q for guix-devel@gnu.org; Wed, 05 Apr 2017 03:47:09 -0400 In-Reply-To: <87wpb02r0t.fsf@gmail.com> (Maxim Cournoyer's message of "Tue, 04 Apr 2017 07:20:34 -0700") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Maxim Cournoyer Cc: guix-devel Hi Maxim, Maxim Cournoyer skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Hi Maxim, >> >> Maxim Cournoyer skribis: >> >>> Unfortunately I cannot reproduce the problem on my side, although you s= eem 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 defa= ult). >>> >>> To help further troubleshoot this, could you please use the provided >>> patch instead, where I inserted: >>> >>>=20=20 >>> (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/ma= n/"))))) >>>=20=20 >>> (define (populate-manpages-collection-dir entries) >>> >>> to print the unexpectedly formed manpage-path. >> >> The problem happens with "/gnu/store/rn3vri602z3jpwqnha0r5nwxi6v0qpnx-te= xlive-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/rn3vri602z3jpwqnha0r5n= wxi6v0qpnx-texlive-2016/share/man -> /gnu/store/8mhqravbd3pv7x1y2qfjlv0bdjc= hszn0-texlive-bin-2016/share/man >> >> =E2=80=98find-files=E2=80=99 uses =E2=80=98lstat=E2=80=99 by default, wh= ich means it does not follow >> symlinks, and I guess that=E2=80=99s what=E2=80=99s happening here. Per= haps >> =E2=80=98find-files=E2=80=99 needs to be called with #:stat stat to use = =E2=80=98stat=E2=80=99 instead >> of =E2=80=98lstat=E2=80=99? >> >> Thanks, >> Ludo=E2=80=99. > > 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)) >=20=20 > (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/ma= n/"))))) >=20=20 > (define (populate-manpages-collection-dir entries) > - (let ((manpages (append-map find-files entries))) > + (let ((manpages (append-map (cut find-files <> #:stat stat) en= tries))) > (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")))) >=20=20 > (gexp->derivation "manual-database" build > - #:modules '((guix build utils)) > + #:modules '((guix build utils) > + (srfi srfi-26)) > #:local-build? #t)) >=20=20 > (define %default-profile-hooks > > > I think we're closing in... :) > > Maxim The attachment is missing from your message (it=E2=80=99s marked as =E2=80=9Cmessage/external-body=E2=80=9D, which AIUI means that it would jus= t look for a same-named file on the recipient=E2=80=99s machine.) Could you resend it? = :-) Thanks, Ludo=E2=80=99.