From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:33153) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3yBj-0004tp-35 for guix-patches@gnu.org; Tue, 18 Feb 2020 03:25:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3yBh-0004Sw-UJ for guix-patches@gnu.org; Tue, 18 Feb 2020 03:25:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:33547) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j3yBh-0004Ss-Qa for guix-patches@gnu.org; Tue, 18 Feb 2020 03:25:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j3yBh-0006ae-MP for guix-patches@gnu.org; Tue, 18 Feb 2020 03:25:01 -0500 Subject: [bug#39547] [PATCH] website: Provide JSON sources list used by Software Heritage. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200210170418.32076-1-zimon.toutoune@gmail.com> <87pnehk1de.fsf@gnu.org> <8736bdjwqx.fsf@inria.fr> Date: Tue, 18 Feb 2020 09:24:49 +0100 In-Reply-To: (zimoun's message of "Mon, 17 Feb 2020 18:59:24 +0100") Message-ID: <87v9o4nvzi.fsf@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: zimoun Cc: 39547@debbugs.gnu.org Hi! zimoun skribis: > On Fri, 14 Feb 2020 at 11:20, Ludovic Court=C3=A8s wrote: >> zimoun skribis: > >> >> Could you, in a first patch, move =E2=80=98origin->json=E2=80=99 out = of >> >> =E2=80=98packages-json-builder=E2=80=99, and in a second patch, add m= irror-expansion >> >> feature? >> > >> > Yes, I will try but I am a bit lost. There is: >> > - packages-json-builder that I did not modified >> > - sources-json-builder which the "adaptation" of the former to output >> > to the sources.json format. >> > >> > Well, do you want a refactor of 'origin->json' shared by the 2 >> > "{sources,packages}-json-builder"? >> >> Yes, exactly. No reason to have two copies of that code. > > The minor "issue" is the 'match' piece of 'origin->json': > > `(("url" . ,(match uri > ((? string? url) (vector url)) > ((urls ...) (list->vector urls)))))) > > > Because in the 'sources.json' it is always one unique string. > However, in 'packages.json' it is always a vector of one or several > elements. And in the previous patch, the job of 'resolve' was to > uniquify these elements for 'sources.json'. Ah, good point. What about adding a keyword parameter to =E2=80=98origin->= json=E2=80=99 that would tell whether to return a single URL or a list thereof? > For example, see the package 'adns' in 'packages.json' > > { > "name": "adns", > "version": "1.5.1", > "source": { > "type": "url", > "url": [ > "mirror://gnu/adns/adns-1.5.1.tar.gz", > "http://www.chiark.greenend.org.uk/~ian/adns/ftp/adns-1.5.1.tar.g= z" > ] > }, > "synopsis": "Asynchronous DNS client library and utilities", > "homepage": "https://www.gnu.org/software/adns/", > "location": "gnu/packages/adns.scm:32" > }, > > > > Just to be on the same wavelength, does 'packages.json' stay as it is > (vector for the source url field)? I think =E2=80=98packages.json=E2=80=99 should still return a list of URLs. I=E2=80=99ve also added a comment asking whether =E2=80=98sources.json=E2= =80=99 could be changed to contain a list of URLs: https://forge.softwareheritage.org/D2025#64037 > Or is 'packages.json' modified to record only one url for the source > url field with mirror:// expanded? Yeah, I think we can expand mirror URLs. Thanks, Ludo=E2=80=99.