From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: Re: [PATCH] profiles: Generate database file for manpages Date: Tue, 04 Apr 2017 07:20:34 -0700 Message-ID: <87wpb02r0t.fsf@gmail.com> 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> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvPK7-0006C7-QF for guix-devel@gnu.org; Tue, 04 Apr 2017 10:20:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvPK6-0000mU-RJ for guix-devel@gnu.org; Tue, 04 Apr 2017 10:20:43 -0400 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") 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludovic, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> Unfortunately I cannot reproduce the problem on my side, although you se= em 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 defau= lt). >> >> 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-tex= live-2016/share/man" (no > trailing slash): > > $ ls -l "/gnu/store/rn3vri602z3jpwqnha0r5nwxi6v0qpnx-texlive-2016/share/m= an" > lrwxrwxrwx 2 root root 70 Jan 1 1970 /gnu/store/rn3vri602z3jpwqnha0r5nw= xi6v0qpnx-texlive-2016/share/man -> /gnu/store/8mhqravbd3pv7x1y2qfjlv0bdjch= szn0-texlive-bin-2016/share/man > > =E2=80=98find-files=E2=80=99 uses =E2=80=98lstat=E2=80=99 by default, whi= ch means it does not follow > symlinks, and I guess that=E2=80=99s what=E2=80=99s happening here. Perh= aps > =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: --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Transfer-Encoding: quoted-printable @@ -954,7 +954,8 @@ files for the fonts of the @var{manifest} entries." (define build #~(begin (use-modules (guix build utils) =2D (srfi srfi-1)) + (srfi srfi-1) + (srfi srfi-26)) =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/man/= "))))) =20 (define (populate-manpages-collection-dir entries) =2D (let ((manpages (append-map find-files entries))) + (let ((manpages (append-map (cut find-files <> #:stat stat) entr= ies))) (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 (gexp->derivation "manual-database" build =2D #:modules '((guix build utils)) + #:modules '((guix build utils) + (srfi srfi-26)) #:local-build? #t)) =20 (define %default-profile-hooks --=-=-= Content-Type: text/plain I think we're closing in... :) Maxim --=-=-= Content-Type: message/external-body; name="~/src/guix/0001-profiles-Generate-database-file-for-manpages.patch"; access-type=local-file Content-Type: text/x-patch Content-ID: <87vaqk2r0t.fsf@gmail.com> Content-Transfer-Encoding: binary --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAljjq7IACgkQEmDkZILm NWJS2BAAmSdcV+WDs6jy2DkLzKGh7FhKvnKdMGyh/lc3mtScDL8l3BQb2O+OWGrJ 31vfI7bUG8CvOTe3uXrd22x+Qjr+cnocfsrrYwxb36YHi3ziDDq5FxVnXt9qZ00p YoMxBMzgrqWLUs11xyuEyPMql6MtZUoVhPjA74/TljFmG4d+8vfkNQOoiffgfB0I 5rglXApAP9FxK2uRa2mmEZREdSyrkvu7xGASZ5kpJ49VbC0wnFZhpcatqzU0B9LK QK7LM9vh19508lncpH/NztAT8Cu27qnrF/FqN0i9S+7IMw4g/wZJyEg5TjqwkzRm 0UcmeiQNOnk+uEEqeDPqI68fxdNty1DA6XqS1dfrSqP+DPoeJwb5K7prf9qaEWiL BwvdEExvmChbmIQV5DpRWmGHCnd9h6nojLXG/1kg7BOPJjGimnsaLbs5N5K9RRNc FIWv6jBX5JqeHTlPyOnJ6oFTLOYG2cXuzYh8T4BMQRb0zd4tUeF6YdP7dzp3H6Ts As4pYtBsG5/xqFAGr79N1r39zqfg+seZjn3FCokNAgKejx4r1E4iks4ckumXAOPR No7umHTZ4laezJus+WG9bMfKNTHvC/kZS6XUBEzHXVjPZHb9LTEBtxBbH+GZhN75 Tw+VvSwGvV3QYyLmcVCbY8Ecj7YgxMMWb/FyVJm4kbILdmUUAKg= =vdEV -----END PGP SIGNATURE----- --==-=-=--