From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AEaBLnG8Y18tOgAA0tVLHw (envelope-from ) for ; Thu, 17 Sep 2020 19:43:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id CGBPKnG8Y199SwAAB5/wlQ (envelope-from ) for ; Thu, 17 Sep 2020 19:43:45 +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 539B4940668 for ; Thu, 17 Sep 2020 19:43:45 +0000 (UTC) Received: from localhost ([::1]:48626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIzom-0003Sm-07 for larch@yhetil.org; Thu, 17 Sep 2020 15:43:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIzmA-0001h9-3V for guix-patches@gnu.org; Thu, 17 Sep 2020 15:41:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIzm9-0003tC-QD for guix-patches@gnu.org; Thu, 17 Sep 2020 15:41:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kIzm9-0006nF-OG for guix-patches@gnu.org; Thu, 17 Sep 2020 15:41:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43477] [PATCH 1/1] guix: graph: Add 'plain' backend. References: <20200917193931.14699-1-zimon.toutoune@gmail.com> In-Reply-To: <20200917193931.14699-1-zimon.toutoune@gmail.com> Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Sep 2020 19:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43477 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43477@debbugs.gnu.org Cc: zimoun Received: via spool by 43477-submit@debbugs.gnu.org id=B43477.160037164426084 (code B ref 43477); Thu, 17 Sep 2020 19:41:01 +0000 Received: (at 43477) by debbugs.gnu.org; 17 Sep 2020 19:40:44 +0000 Received: from localhost ([127.0.0.1]:39153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIzls-0006md-Hd for submit@debbugs.gnu.org; Thu, 17 Sep 2020 15:40:44 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:52830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIzlr-0006mR-GV for 43477@debbugs.gnu.org; Thu, 17 Sep 2020 15:40:43 -0400 Received: by mail-wm1-f54.google.com with SMTP id q9so3083426wmj.2 for <43477@debbugs.gnu.org>; Thu, 17 Sep 2020 12:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tb8L//YchfWvEKDf6KrIOBoViMNtDbsQM/kNWVWpvks=; b=hgmIHMMjEqDESAvXTVkp5hTb9IGv0H9qBQX4mS0US1eJAOMjuOO77/BkFaK+FUrBQZ hOU10b0FEn40cBR+tD61HPno2A6Q2PRI1xxxz2vCaegoLtnYCyyJL/tYceA/4Z1imsV3 Uez8hZmHQywofGQdN8YDvhFEbXDJKgKuJ6ZpOZ3LJpax8/H7rK/ZFULoz5qPAaoXAndD e7tz4EQovCalNfOv6abPmg4vPskNBx8rsrt6fKpYoHoSPUhBfsib0eohPLGEv+3dH2En 9t4Dw8szNtoauux8YjvjfmaYu4jD/unp+mzf0py7zDKlZ7BQCiKF5ZdYFEL3TBV3oDK4 d4Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tb8L//YchfWvEKDf6KrIOBoViMNtDbsQM/kNWVWpvks=; b=KcqpH0Gh9LxnWxSmX2mAZlQH6PblPZEIjIeY9qW3BViyke+n8mHUn86Jl8V6R1qCgL ZbNKBhxnmki7a5N/ww8LF0LHedebf9B+UgAxPN6U8IYZwQYkxVLI5F6ob9XuyG4IRk6a 3ye194pez00ulw1EitQYunp0a3/akJPqlnEdrjVU4eIQByekfm/2Y91ZxF/8bdDX2fZe XPe5em9UHe8sdUZye6KvtjvbDwFCdd+s/2q9K/bntJkKn0KSCbhEHheGO8y+IqJ9Tib9 gU1HXxiGvQREYQb3Gj5BBcDZDFmJ1iRDIIvMVyzNFDUAEouiEp6oL+8oJDZjqmOsepir MD+Q== X-Gm-Message-State: AOAM533sxX8ASz/itbRDIxD1j8pMvmANCtofmZKW99yeN3FjwE2LWb98 zl9R/PjvK4Rb9FjUSWdUvFKFUWzdEnE= X-Google-Smtp-Source: ABdhPJzYVU6luqry8DcPC5ihd8xi1/j09bK84QTVISkUgLpwlQkcWyRvW5rHoeSbon4e1TVOTutdhw== X-Received: by 2002:a1c:96:: with SMTP id 144mr11765907wma.84.1600371637261; Thu, 17 Sep 2020 12:40:37 -0700 (PDT) Received: from lili.univ-paris-diderot.fr ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id z14sm832096wrh.14.2020.09.17.12.40.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 12:40:36 -0700 (PDT) From: zimoun Date: Thu, 17 Sep 2020 21:40:32 +0200 Message-Id: <20200917194032.15103-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=hgmIHMMj; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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-Spam-Score: 0.09 X-TUID: Gmf09+U7oDWu * guix/graph.scm: (emit-plain-prologue, emit-plain-epilogue, emit-plain-node, emit-plain-edge): New procedures. (%plain-backend): New variable. (%graph-backends): Update variable. --- guix/graph.scm | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/guix/graph.scm b/guix/graph.scm index b695ca4306..4be864b29a 100644 --- a/guix/graph.scm +++ b/guix/graph.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2016, 2020 Ludovic Courtès ;;; Copyright © 2016 Ricardo Wurmus +;;; Copyright © 2020 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -324,6 +325,28 @@ nodeArray.push(nodes[\"~a\"]);~%" emit-cypher-prologue emit-cypher-epilogue emit-cypher-node emit-cypher-edge)) + +;;; +;;; Plain export +;;; + +(define (emit-plain-prologue name port) + (format port "")) + +(define (emit-plain-epilogue port) + (format port "")) + +(define (emit-plain-node id label port) + (format port "~a~%" label)) + +(define (emit-plain-edge id1 id2 port) + (format port "")) + +(define %plain-backend + (graph-backend "plain" + "Generate Plain queries." + emit-plain-prologue emit-plain-epilogue + emit-plain-node emit-plain-edge)) ;;; @@ -333,7 +356,8 @@ nodeArray.push(nodes[\"~a\"]);~%" (define %graph-backends (list %graphviz-backend %d3js-backend - %cypher-backend)) + %cypher-backend + %plain-backend)) (define* (export-graph sinks port #:key -- 2.28.0