From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eGrMGUJobWESLAEAgWs5BA (envelope-from ) for ; Mon, 18 Oct 2021 14:27:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id gLqRFUJobWG9ZAAA1q6Kng (envelope-from ) for ; Mon, 18 Oct 2021 12:27:46 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C765034EFB for ; Mon, 18 Oct 2021 14:27:45 +0200 (CEST) Received: from localhost ([::1]:44936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcRk0-0004tn-VN for larch@yhetil.org; Mon, 18 Oct 2021 08:27:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcRga-0001X0-7e for guix-patches@gnu.org; Mon, 18 Oct 2021 08:24:15 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mcRgQ-0000pr-8l for guix-patches@gnu.org; Mon, 18 Oct 2021 08:24:10 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mcRgQ-0005FL-39 for guix-patches@gnu.org; Mon, 18 Oct 2021 08:24:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50515] (guix-artwork)[PATCH 0/2] List linux origins in 'sources.json'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 18 Oct 2021 12:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50515 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 50515@debbugs.gnu.org Received: via spool by 50515-submit@debbugs.gnu.org id=B50515.163455983920158 (code B ref 50515); Mon, 18 Oct 2021 12:24:02 +0000 Received: (at 50515) by debbugs.gnu.org; 18 Oct 2021 12:23:59 +0000 Received: from localhost ([127.0.0.1]:46157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcRgN-0005F3-Hz for submit@debbugs.gnu.org; Mon, 18 Oct 2021 08:23:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcRgL-0005Er-79 for 50515@debbugs.gnu.org; Mon, 18 Oct 2021 08:23:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36640) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcRgG-0000h4-0Y; Mon, 18 Oct 2021 08:23:52 -0400 Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58414 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcRgF-0000RU-Nh; Mon, 18 Oct 2021 08:23:51 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211005140937.19272-1-zimon.toutoune@gmail.com> <20211005140937.19272-2-zimon.toutoune@gmail.com> Date: Mon, 18 Oct 2021 14:23:49 +0200 In-Reply-To: <20211005140937.19272-2-zimon.toutoune@gmail.com> (zimoun's message of "Tue, 5 Oct 2021 16:09:37 +0200") Message-ID: <87tuhea5d6.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634560066; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=bkzaVM9irJMbkgcI0giVK5Cwwr0P9XvStlJ4eI9Ax+A=; b=QYr/GaeB+Orxw0wF5VWeH3e+AcskSt7zD6/QZmHalyn9QusE84/NfMhrg1oz22tTQW7lnm HUSCVgKuE0oGbs/bf3azghWGLu4CE6RPMYf3VNFPNnnoe/nD/qlQ2Czr+nTyS/3ntNsAWi EM6L6SEoxwAlBkEpre+/MlLsVQyM/YIm+82CXZrI2L1RskMyFIGCYj5UTgc5KJeyyrMXGp Y40OtgycFTGBMj5x6VDF4eFm/CyuAH5uillpA/Fy1JQ0NXuvKVqtFoGKxIbJG8YYqKmNPl tToX7T0il3WdesG4mEBryGigY+uivIEpiZr9eNtvjdnJyP4vS7B0p4qECwdIuw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634560066; a=rsa-sha256; cv=none; b=Np2ZO9nBVCblMhhIY9VycjEemyat3nyl2h3N2/9vpma9Vqg8TYA99W8SN19IksRWAX7cyh kojZP7z22iaqHobsoceSdx9xUTPfi685H9R3qkNenuKbEFtLAOTGRny2RiCZHEAD8y64Lx CE60NFIU9hhO2upIw5khHhbDBqWaJUkAiL6def9JLRUaUKa5mLjaJgnpdk+DfyANauOfgJ KG/SQrEpwWCNRMvCnoqJpdyj2TSszBBMQHnHIZk6ME2BO7ZIbBwwSe2lzuAYw39l603pW0 b+8lShhU1HepCR9rnYFKSRqhfkFKFpUD1hv4m9EULe9oB3LK6DB09iIUGAM+yQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: C765034EFB X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: 44HxBJ3EnEIl Hi! zimoun skribis: > With Guix 9875f9bca3976bf3576eab9be42164fde454597e, the packages consider= ed > are IceCat and the Linux kernel; see: gnu/packages/gnuzilla.scm and > gnu/packages/linux.scm. > > * website/apps/packages/builder.scm (gexp-references): Unexported procedu= re > from the module '(guix gexp)'. > (origin->json): Add 'computed-origin-method' case. > (package-json-builder): Adjust. > (sources-json-builder): Idem. > [flatten]: New procedure. Apologies for the looong delay! > +;;; Required by 'origin->json' for 'computed-origin-method' corner cases > +(define gexp-references (@@ (guix gexp) gexp-references)) Hmm not great. The only public API that would allow us to approximate it is =E2=80=98lower-gexp=E2=80=99, but it requires access to the daemon, s= o it=E2=80=99s not suitable. Let=E2=80=99s keep it this way! > (define (package->json package) > `(,@(if (origin? (package-source package)) > (origin->json (package-source package)) > - `(("type" . "no-origin") > + `((type . "no-origin") > ("name" . ,(package-name package)))))) >=20=20 > + (define (flatten lst) > + ;; Convert nested lists to simple list > + `(,@(if (null? lst) > + '() > + (match lst > + ((head tail ...) > + (match head > + ((('type . x) other ...) > + (cons head (flatten tail))) > + (_ > + (append (flatten head) (flatten tail))))))))) > + > (make-page "sources.json" > - `(("sources" . ,(list->vector (map package->json (all-packa= ges)))) > + `(("sources" . ,(list->vector (flatten (map package->json (= all-packages))))) Maybe we should just change =E2=80=98package->json=E2=80=99 to always retur= n a list of JSON records (alists)? That way, we would write: (append-map package->json (all-packages)) which I find slightly clearer. WDYT? Otherwise LGTM, thanks! Ludo=E2=80=99.