unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Christopher Baines <mail@cbaines.net>
Cc: "Ludovic Courtès" <ludo@gnu.org>, 42019@debbugs.gnu.org
Subject: [bug#42019] [PATCH 1/1] website: Add integrity to JSON sources.
Date: Wed, 01 Jul 2020 22:29:00 +0200	[thread overview]
Message-ID: <86366b9dyr.fsf@gmail.com> (raw)
In-Reply-To: <87d05f2flv.fsf@cbaines.net>

Hi Chris,

On Wed, 01 Jul 2020 at 20:35, Christopher Baines <mail@cbaines.net> wrote:

> A question maybe for you Simon, what would be the perfect data for this
> particular use case? I gather it's something about the (source ...)
> field in packages, probably for all the exported (plus maybe
> not-exported packages).

Currently the website builds source.json by using 'fold-packages'
(traversing all the modules and returning all the public variables, if I
read correctly) then excluding 'package-superseded' and
'package-replacement'.

Well, maybe an example is simpler than a lot of words.  The resulting
JSON looks like:

--8<---------------cut here---------------start------------->8---
    {
      "type": "url",
      "urls": [
        "https://ftpmirror.gnu.org/gnu/a2ps/a2ps-4.14.tar.gz",
        "ftp://ftp.cs.tu-berlin.de/pub/gnu/a2ps/a2ps-4.14.tar.gz",
        "ftp://ftp.funet.fi/pub/mirrors/ftp.gnu.org/gnu/a2ps/a2ps-4.14.tar.gz",
        "http://ftp.gnu.org/pub/gnu/a2ps/a2ps-4.14.tar.gz"
      ],
      "integrity": "sha256-866NPUVkpBtuKiHyN9LysQT0gQhZHouDSXUAGCo6s6Q="
    },
    {
      "type": "git",
      "git_url": "https://github.com/opencog/agi-bio.git",
      "git_ref": "b5c6f3d99e8cca3798bf0cdf2c32f4bdb8098efb"
    },
--8<---------------cut here---------------end--------------->8---

So basically, the data are: origin-method, origin-uri (implies reference
URLs and {git,hg,svn}-{commit,revision}), origin-hash (implies
content-hash-{value,algorithm}).  Note that the list of mirrors are
necessary too.

I have given a look to

  http://git.savannah.gnu.org/cgit/guix/data-service.git/tree/

but I am not sure to understand where the SQL table is defined.


Thanks,
simon




  reply	other threads:[~2020-07-01 20:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 15:13 [bug#42019] [PATCH 0/1] sources.json compliant with SWH loader zimoun
2020-06-23 15:21 ` [bug#42019] [PATCH 1/1] website: Add integrity to JSON sources zimoun
2020-06-27 17:05   ` Ludovic Courtès
2020-06-27 17:41     ` zimoun
2020-06-29 17:01       ` zimoun
2020-06-29 20:41         ` Ludovic Courtès
2020-06-29 23:28           ` zimoun
2020-07-01 19:35             ` Christopher Baines
2020-07-01 20:29               ` zimoun [this message]
2020-06-29 16:50 ` [bug#42019] [PATCH v2] " zimoun
2020-07-06 10:20   ` bug#42019: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86366b9dyr.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=42019@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=mail@cbaines.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).