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: Tue, 04 Apr 2017 14:29:37 +0200 Message-ID: <87efx8s6dq.fsf@gnu.org> References: <87fuhvw4a8.fsf@gmail.com> <87a882wykx.fsf@gnu.org> <87tw69538i.fsf@gmail.com> <8737dtjcbh.fsf@gnu.org> <8760il4iie.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]:36413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvNah-0006sh-B4 for guix-devel@gnu.org; Tue, 04 Apr 2017 08:29:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvNae-0007FJ-19 for guix-devel@gnu.org; Tue, 04 Apr 2017 08:29:43 -0400 In-Reply-To: <8760il4iie.fsf@gmail.com> (Maxim Cournoyer's message of "Mon, 03 Apr 2017 08:29:13 -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: > Unfortunately I cannot reproduce the problem on my side, although you see= m 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 defaul= t). > > 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/man/= "))))) >=20=20 > (define (populate-manpages-collection-dir entries) > > to print the unexpectedly formed manpage-path. The problem happens with "/gnu/store/rn3vri602z3jpwqnha0r5nwxi6v0qpnx-texli= ve-2016/share/man" (no trailing slash): --8<---------------cut here---------------start------------->8--- $ ls -l "/gnu/store/rn3vri602z3jpwqnha0r5nwxi6v0qpnx-texlive-2016/share/man" lrwxrwxrwx 2 root root 70 Jan 1 1970 /gnu/store/rn3vri602z3jpwqnha0r5nwxi= 6v0qpnx-texlive-2016/share/man -> /gnu/store/8mhqravbd3pv7x1y2qfjlv0bdjchsz= n0-texlive-bin-2016/share/man --8<---------------cut here---------------end--------------->8--- =E2=80=98find-files=E2=80=99 uses =E2=80=98lstat=E2=80=99 by default, which= means it does not follow symlinks, and I guess that=E2=80=99s what=E2=80=99s happening here. Perhaps =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.