GNU bug report logs - #39547
[PATCH] website: Provide JSON sources list used by Software Heritage.

Previous Next

Package: guix-patches;

Reported by: zimoun <zimon.toutoune <at> gmail.com>

Date: Mon, 10 Feb 2020 17:05:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludovic.courtes <at> inria.fr>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: 39547 <at> debbugs.gnu.org
Subject: [bug#39547] [PATCH] website: Provide JSON sources list used by Software Heritage.
Date: Mon, 17 Feb 2020 18:59:24 +0100
Hi Ludo,

On Fri, 14 Feb 2020 at 11:20, Ludovic Courtès <ludovic.courtes <at> inria.fr> wrote:
> zimoun <zimon.toutoune <at> gmail.com> skribis:

> >> Could you, in a first patch, move ‘origin->json’ out of
> >> ‘packages-json-builder’, and in a second patch, add mirror-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':

--8<---------------cut here---------------start------------->8---
               `(("url" . ,(match uri
                             ((? string? url) (vector url))
                             ((urls ...) (list->vector urls))))))
--8<---------------cut here---------------end--------------->8---

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'.

For example, see the package 'adns' in 'packages.json'

--8<---------------cut here---------------start------------->8---
{
    "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.gz"
      ]
    },
    "synopsis": "Asynchronous DNS client library and utilities",
    "homepage": "https://www.gnu.org/software/adns/",
    "location": "gnu/packages/adns.scm:32"
  },
--8<---------------cut here---------------end--------------->8---



Just to be on the same wavelength, does 'packages.json' stay as it is
(vector for the source url field)?
Or is 'packages.json' modified to record only one url for the source
url field with mirror:// expanded?


Cheers,
simon




This bug report was last modified 5 years and 160 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.