From unknown Tue Jun 17 20:30:52 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#33448 <33448@debbugs.gnu.org> To: bug#33448 <33448@debbugs.gnu.org> Subject: Status: [PATCH] describe: Fix 'format' option. Reply-To: bug#33448 <33448@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:30:52 +0000 retitle 33448 [PATCH] describe: Fix 'format' option. reassign 33448 guix-patches submitter 33448 Oleg Pykhalov severity 33448 normal tag 33448 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 20 17:26:50 2018 Received: (at submit) by debbugs.gnu.org; 20 Nov 2018 22:26:51 +0000 Received: from localhost ([127.0.0.1]:37521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPETo-0002gD-RI for submit@debbugs.gnu.org; Tue, 20 Nov 2018 17:26:49 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPETm-0002fw-IM for submit@debbugs.gnu.org; Tue, 20 Nov 2018 17:26:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPETg-0003Ux-OX for submit@debbugs.gnu.org; Tue, 20 Nov 2018 17:26:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47634) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPETg-0003US-L9 for submit@debbugs.gnu.org; Tue, 20 Nov 2018 17:26:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPETf-0008F2-PQ for guix-patches@gnu.org; Tue, 20 Nov 2018 17:26:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPETa-00030i-PK for guix-patches@gnu.org; Tue, 20 Nov 2018 17:26:39 -0500 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]:38705) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gPETa-0002x7-E2 for guix-patches@gnu.org; Tue, 20 Nov 2018 17:26:34 -0500 Received: by mail-lj1-x232.google.com with SMTP id c19-v6so3068249lja.5 for ; Tue, 20 Nov 2018 14:26:34 -0800 (PST) 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=IqmdGEQe4Jb5y5KxQgPoISF4aji6GneIeRg3cnPxb60=; b=Mi7NprXHYbd+RCLRkllfCXgx63hya3vZhkLBqEebOb/z0fV9OAuV2oLOSyqJWQYCyU 3kM7be52QW6Xl1QDHbvUGClnBe/nOnSuSNchbU1RXE5K16ygBxjbJUx76ZxqTmlAlAXc m8AlVC0nd8u4db6gB1OsyVJG5+Md80jpnLHkvfzeLQGBE6guvqPdwOCsA2lwCKoMWCsk ckMwFkkRtTjQsRbujgLmvKe9Q4yWcSMybUM/VeeOYKr6agsoA4RvuzS2kkYd31fwIoZK Ki7UggFpy++tpXRxgPuHaA3KZcggloLvnKpn2zppNRSb3vcj5c3PwivqWOiOMy5zx1PB KYGw== 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=IqmdGEQe4Jb5y5KxQgPoISF4aji6GneIeRg3cnPxb60=; b=YMtKnXq5hmHt/ZS+zmRwJC5K2eeVp6Mu5HaAj8PRCKf6XixWCvHTis8juvrD5OoEMi n6nUrdLflYilAN1pP4IeiLLf3a14iCItgNVds24pUZLvEFARhjVqhu69GjQAQPTimOyj Rp2mOydcl5q/ulR2xDFs/2qzxQlq4fQoFPm2eXsgh++kHUtY91jTdv/JPis8KYlxFCjx wAX4n32cBCDMmegp62DFxgCBrVVZgWAlfBiOrOA6divvejmpPueRX+8LYHOEu5FR0qIC nEHGPUg58PyZxjU4NpTdQF20NfB/BS/Wqq7du3on7VqV4hMVpUVXhs52LoGcqXNimejR 5+hA== X-Gm-Message-State: AA+aEWZT3gbqfSH0vJ4f3kiJddosE5kWznk+d3yxTzn4a8Baqu+k6PVR 4aRrKz5M+MRvuM0+6SoyFVL86PRyu+6bpw== X-Google-Smtp-Source: AFSGD/Uhq05GwiGgDYGENdJ3FACUka64yvIbdeG0jwEmRASmC6gBOnCIRGfmUvhT3K4bVwhVN+TjHQ== X-Received: by 2002:a2e:8546:: with SMTP id u6-v6mr2246761ljj.95.1542752792455; Tue, 20 Nov 2018 14:26:32 -0800 (PST) Received: from localhost.localdomain (pppoe.95-55-182-67.dynamic.avangarddsl.ru. [95.55.182.67]) by smtp.gmail.com with ESMTPSA id e82sm2158071lfg.34.2018.11.20.14.26.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 14:26:31 -0800 (PST) From: Oleg Pykhalov To: guix-patches@gnu.org Subject: [PATCH] describe: Fix 'format' option. Date: Wed, 21 Nov 2018 01:26:16 +0300 Message-Id: <20181120222616.3941-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: Oleg Pykhalov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Fix ‘guix describe’ ignores ‘--format=FORMAT’ option. * guix/scripts/describe.scm (%options): Fix 'format' option. --- guix/scripts/describe.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm index e59502076..d3203e992 100644 --- a/guix/scripts/describe.scm +++ b/guix/scripts/describe.scm @@ -40,7 +40,7 @@ (lambda (opt name arg result) (unless (member arg '("human" "channels")) (leave (G_ "~a: unsupported output format~%") arg)) - (alist-cons 'format 'channels result))) + (alist-cons 'format (string->symbol arg) result))) (option '(#\h "help") #f #f (lambda args (show-help) -- 2.19.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 02:01:11 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 07:01:11 +0000 Received: from localhost ([127.0.0.1]:37735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPMVa-0002CN-Oj for submit@debbugs.gnu.org; Wed, 21 Nov 2018 02:01:11 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:40559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPMVY-0002C9-JZ for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 02:01:09 -0500 Received: by mail-lj1-f195.google.com with SMTP id n18-v6so3848262lji.7 for <33448@debbugs.gnu.org>; Tue, 20 Nov 2018 23:01:08 -0800 (PST) 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=wyZgqp+TtKuRaeZuoNMExx16aINpGu/0/vW0Z7+VLm0=; b=ubSQklEQ8DYOqfJGaHyh8+D3hcQ0ewYSnDUZ320CojeizucyzXh6V7j7gBS4rbzXf/ uPGkWMsNoG+bTSwWxz7+DlZ80nQenh4mwMXdeVdgs2nzuzz5n4YOYynyNK+5+TKuYI+2 PeDLky3XxBpYC/IKovvc6S3A4/Cck3sZfuFv9Ys1WmEURSXOnYdqO2xnq8xUZpM/3jhY 8ISha0PrRGzn1N9rTJ9gzQVWS1vsQoen4vAgKZ7UcFACTts2qdyDrnrGZ643YGNcw9rx o3qo9vEtI4IoUY8MiCJ/EqeQYIejaE+Ll4zzoLvMpeKHv2s1pFZVdk41yd9BpUOquP1R YpMQ== 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=wyZgqp+TtKuRaeZuoNMExx16aINpGu/0/vW0Z7+VLm0=; b=ThcVApqIC8f6GdFrzDGa/ckhZ/SqZ8Uw7n0+VtvrToor7xLV85yvDl4aSy9yqJvaBp nJ6fev9lvyt22A9rbl7gFiyUdoL5VbS9iCv/0hhgy73wsGxlAE0cFuzCcQu8j9DpWmKR rJwNv3rcml7W2SHoTZBKpEnagVhMwvLGVOHmIgXsTBu5VH3FN16PnTqM3fdmYGcSwd5E ZdXwTyJYkXfjlWtttoYCAXKV5aZmLS48mhG/gJKcn5yBkI1oskpqqAvNfS0cYiCMVGHU VohzbLsiovj9G8YGJAdMJX4T7WRDO7So0XL15ri88TLOWku511o0748MpsPDxyrebT4T l+WA== X-Gm-Message-State: AGRZ1gK6YDkPNNPzPx3ibpKz3eZEGX8hKgsB4VqKUT21qkwgsKABxS7x 7wfy8m6EJnJUK2svx88Q3jyqp+7mLoU= X-Google-Smtp-Source: AFSGD/UC2Ljgt3TiU7/Wu5lqtO2LgTB2aOJiXdHGiqJDJ1jNzhpJwTaDVlRD2uW0yQCTZFWGqnzq4w== X-Received: by 2002:a2e:8596:: with SMTP id b22-v6mr3169712lji.122.1542783662287; Tue, 20 Nov 2018 23:01:02 -0800 (PST) Received: from localhost.localdomain (95-55-9-11.dynamic.avangarddsl.ru. [95.55.9.11]) by smtp.gmail.com with ESMTPSA id w9sm6283753lfc.66.2018.11.20.23.01.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 23:01:01 -0800 (PST) From: Oleg Pykhalov To: 33448@debbugs.gnu.org Subject: [PATCH] describe: Add json format. Date: Wed, 21 Nov 2018 10:00:51 +0300 Message-Id: <20181121070051.12041-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33448 Cc: Oleg Pykhalov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * guix/scripts/describe.scm: Add json format. --- guix/scripts/describe.scm | 69 +++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 25 deletions(-) diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm index d3203e992..53195b423 100644 --- a/guix/scripts/describe.scm +++ b/guix/scripts/describe.scm @@ -23,6 +23,7 @@ #:use-module (guix profiles) #:use-module ((guix scripts pull) #:select (display-profile-content)) #:use-module (git) + #:use-module (json) #:use-module (srfi srfi-1) #:use-module (srfi srfi-37) #:use-module (ice-9 match) @@ -38,7 +39,7 @@ ;; Specifications of the command-line options. (list (option '(#\f "format") #t #f (lambda (opt name arg result) - (unless (member arg '("human" "channels")) + (unless (member arg '("human" "channels" "json")) (leave (G_ "~a: unsupported output format~%") arg)) (alist-cons 'format (string->symbol arg) result))) (option '(#\h "help") #f #f @@ -101,7 +102,12 @@ within a Git checkout." (pretty-print `(list (channel (name 'guix) (url ,(dirname directory)) - (commit ,commit)))))) + (commit ,commit))))) + ('json + (display (scm->json-string `((name . guix) + (url . ,(dirname directory)) + (commit . ,commit)))) + (newline))) (display-package-search-path fmt))) (define (display-profile-info profile fmt) @@ -110,34 +116,47 @@ in the format specified by FMT." (define number (generation-number profile)) + (define (channels format) + (map (lambda (entry) + (match (assq 'source (manifest-entry-properties entry)) + (('source ('repository ('version 0) + ('url url) + ('branch branch) + ('commit commit) + _ ...)) + (case format + ((scm) + `(channel (name ',(string->symbol + (manifest-entry-name entry))) + (url ,url) + (commit ,commit))) + ((json) + `((name . ,(string->symbol + (manifest-entry-name entry))) + (url . ,url) + (commit . ,commit))))) + + ;; Pre-0.15.0 Guix does not provide that information, + ;; so there's not much we can do in that case. + (_ '???))) + + ;; Show most recently installed packages last. + (reverse + (manifest-entries + (profile-manifest + (if (zero? number) + profile + (generation-file-name profile number))))))) + (match fmt ('human (display-profile-content profile number)) ('channels (pretty-print - `(list ,@(map (lambda (entry) - (match (assq 'source (manifest-entry-properties entry)) - (('source ('repository ('version 0) - ('url url) - ('branch branch) - ('commit commit) - _ ...)) - `(channel (name ',(string->symbol - (manifest-entry-name entry))) - (url ,url) - (commit ,commit))) - - ;; Pre-0.15.0 Guix does not provide that information, - ;; so there's not much we can do in that case. - (_ '???))) - - ;; Show most recently installed packages last. - (reverse - (manifest-entries - (profile-manifest - (if (zero? number) - profile - (generation-file-name profile number)))))))))) + `(list ,@(channels 'scm)))) + ('json + (display (scm->json-string (channels 'json))) + (newline))) (display-package-search-path fmt)) -- 2.19.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 05:47:57 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 10:47:57 +0000 Received: from localhost ([127.0.0.1]:37835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPQ33-0007XJ-2L for submit@debbugs.gnu.org; Wed, 21 Nov 2018 05:47:57 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPQ32-0007X8-6w for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 05:47:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPQ2w-0001kg-A1 for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 05:47:50 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPQ2w-0001kP-6P; Wed, 21 Nov 2018 05:47:50 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=48074 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gPQ2v-00053A-V2; Wed, 21 Nov 2018 05:47:50 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#33448] [PATCH] describe: Fix 'format' option. References: <20181120222616.3941-1-go.wigust@gmail.com> Date: Wed, 21 Nov 2018 11:47:48 +0100 In-Reply-To: <20181120222616.3941-1-go.wigust@gmail.com> (Oleg Pykhalov's message of "Wed, 21 Nov 2018 01:26:16 +0300") Message-ID: <87a7m2u2p7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Oleg Pykhalov skribis: > Fix =E2=80=98guix describe=E2=80=99 ignores =E2=80=98--format=3DFORMAT=E2= =80=99 option. > > * guix/scripts/describe.scm (%options): Fix 'format' option. Oops, good catch. LGTM! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 05:53:42 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 10:53:42 +0000 Received: from localhost ([127.0.0.1]:37842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPQ8c-0007fU-1l for submit@debbugs.gnu.org; Wed, 21 Nov 2018 05:53:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPQ8a-0007fI-Jf for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 05:53:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPQ8U-00024l-K3 for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 05:53:35 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPQ8U-00024Z-H3; Wed, 21 Nov 2018 05:53:34 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37592 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gPQ8U-0005Ou-6p; Wed, 21 Nov 2018 05:53:34 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#33448] [PATCH] describe: Add json format. References: <20181120222616.3941-1-go.wigust@gmail.com> <20181121070051.12041-1-go.wigust@gmail.com> Date: Wed, 21 Nov 2018 11:53:32 +0100 In-Reply-To: <20181121070051.12041-1-go.wigust@gmail.com> (Oleg Pykhalov's message of "Wed, 21 Nov 2018 10:00:51 +0300") Message-ID: <8736ruu2fn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Oleg Pykhalov skribis: > * guix/scripts/describe.scm: Add json format. Please describe the modified and added variables/procedures. > + (define (channels format) > + (map (lambda (entry) > + (match (assq 'source (manifest-entry-properties entry)) > + (('source ('repository ('version 0) > + ('url url) > + ('branch branch) > + ('commit commit) > + _ ...)) > + (case format > + ((scm) > + `(channel (name ',(string->symbol > + (manifest-entry-name entry))) > + (url ,url) > + (commit ,commit))) > + ((json) > + `((name . ,(string->symbol > + (manifest-entry-name entry))) > + (url . ,url) > + (commit . ,commit))))) > + > + ;; Pre-0.15.0 Guix does not provide that information, > + ;; so there's not much we can do in that case. > + (_ '???))) > + > + ;; Show most recently installed packages last. > + (reverse > + (manifest-entries > + (profile-manifest > + (if (zero? number) > + profile > + (generation-file-name profile number))))))) How about turning this into a list of objects, and then, separately have =E2=80=98channels->sexp=E2=80=99 and =E2=80=98channels->jso= n=E2=80=99? That would avoid having dealing with the format in two different places. Also, could you mention the new format in the manual? Last question: what use case do you have in mind regarding the JSON format? I=E2=80=99m asking because we don=E2=80=99t have tools that can co= nsume it so far. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 05:54:14 2018 Received: (at control) by debbugs.gnu.org; 21 Nov 2018 10:54:14 +0000 Received: from localhost ([127.0.0.1]:37846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPQ98-0007gj-Bi for submit@debbugs.gnu.org; Wed, 21 Nov 2018 05:54:14 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56583) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPQ96-0007gW-MP for control@debbugs.gnu.org; Wed, 21 Nov 2018 05:54:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPQ8y-0002hY-VA for control@debbugs.gnu.org; Wed, 21 Nov 2018 05:54:07 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPQ8x-0002cQ-Dv for control@debbugs.gnu.org; Wed, 21 Nov 2018 05:54:03 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=41486 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gPQ8x-0005Pr-1c for control@debbugs.gnu.org; Wed, 21 Nov 2018 05:54:03 -0500 Date: Wed, 21 Nov 2018 11:54:01 +0100 Message-Id: <871s7eu2eu.fsf@gnu.org> To: control@debbugs.gnu.org From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: control message for bug #33448 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) merge 33448 33453 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 06:48:26 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 11:48:26 +0000 Received: from localhost ([127.0.0.1]:37898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPQza-0002gZ-IU for submit@debbugs.gnu.org; Wed, 21 Nov 2018 06:48:26 -0500 Received: from mail-lj1-f176.google.com ([209.85.208.176]:41737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPQzX-0002gB-2K for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 06:48:25 -0500 Received: by mail-lj1-f176.google.com with SMTP id z80-v6so4548721ljb.8 for <33448@debbugs.gnu.org>; Wed, 21 Nov 2018 03:48:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=U0ROPuRXwUU3brNwmKoWNOD050IpLC0OqtNIInOaKrs=; b=AcTydrv9fiJMeAM2shb3pD/sb+Bl/UFdpJR0QxyRMx3Riv2CLU4z6uHVbdE1bAyUsf p6aeCTewgf72o3wi0l6gkTLV4hMKYI9pjIlSPz7zjgrWtzWFTzlA0UXwspteSK8C5F8j D8rWh1lTL4Vpz9IvMxceSVzAdxO7tGrVzlwZDtnqHqERFxaiDziwSRFl8SkjNN8gcZvw I7fyb4AI5ggKpB4Nib8UYKKQgQLmTZbZlBTlgWl3gBt5nd8ObnzcMWOxyg7KHG4ciBWa nUHmwS4Dkc2tkaqyUJ/4+r7cCCt9CfRcH7PJPJoq4v343OfKbMrj3mFTAvmpYpiIfD+2 xTzQ== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=U0ROPuRXwUU3brNwmKoWNOD050IpLC0OqtNIInOaKrs=; b=TBjFy4wqpeRymeZDUFVNoBHrwz+oc1cLvnPUXMrFicJiXXIYsvH6EgkInWaTLmHa5/ Y5BkAgKgjbNrLlAliDVsfUHsAP4qtwxgDSzj6UKZZuqD2iJ5tUB5hL0tj8kXVxYqOgov ibi+BsUgpOX9csrxFS6WlgBBT7FmaCKEQYq5KbXNIE7phYQ6Yyb0+8pi8GxlSFI4ro1B Ig2NO9hdoIX2Dt47kGLxIFxwr2wADMe1cOUJJVUo5IqJHeF9zWGlyr1DBkOWqBaoQhbr xw7qet41jh5WNsAIQCIxWeGoZP2tuZp2lJdAB9Nfr4f3pgO4Uc1eMZm8xQq7HR34RD3w sHEw== X-Gm-Message-State: AA+aEWagBoD1XlBxsT0rxpG/aaFwdTeWojEyrWZbc0wZQRUU6k1P0ySL GS88diJfCI3V/E1HKE51zWLm7KV0YSo= X-Google-Smtp-Source: AFSGD/Wy8ep+oQrC5lHKk9orl7JcqfCmkHVBJw6dTez118V8VjczjTrMi7bN3Ibnvdh3p/RdPSykmg== X-Received: by 2002:a2e:1603:: with SMTP id w3-v6mr3759631ljd.33.1542800896533; Wed, 21 Nov 2018 03:48:16 -0800 (PST) Received: from magnolia (95-55-9-11.dynamic.avangarddsl.ru. [95.55.9.11]) by smtp.gmail.com with ESMTPSA id u26-v6sm6678402lji.22.2018.11.21.03.48.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Nov 2018 03:48:15 -0800 (PST) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#33448] [PATCH] describe: Fix 'format' option. References: <20181120222616.3941-1-go.wigust@gmail.com> <87a7m2u2p7.fsf@gnu.org> Date: Wed, 21 Nov 2018 14:46:01 +0300 In-Reply-To: <87a7m2u2p7.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 21 Nov 2018 11:47:48 +0100") Message-ID: <87wop67ix2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Oleg Pykhalov skribis: > >> Fix =E2=80=98guix describe=E2=80=99 ignores =E2=80=98--format=3DFORMAT= =E2=80=99 option. >> >> * guix/scripts/describe.scm (%options): Fix 'format' option. > > Oops, good catch. LGTM! Pushed as 3dd28aa37cc3f3a6bbb5f7f8d9fb49cc457b0c10 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAlv1RXkACgkQFn+OpQAa +pxD1g/9EkCgzCWhpFZkiTgioq21lcn0Y1y1cgbchbt0HZBfQMpdW6l+qIaPSJTO Z9L6b7+wyuV+Wvz3X0/XvTdu5nEIlfDNq+VCHvns4vLXIH600B/EZNJ93mEd0TkW fKvhdUqYNJybDpRvNF9zW7IHQS5zUacU4qWP3Jayddo1kUbbRd0le5rwkEHHPFnc olbXo/Cs4cTnUTEuDkjFONAKp+A43VcIrKsKvJKcYSFWqdag2GeHjfhOoWNuGjrM LjyIIhHgWb2rkxPthglk9W8+tLA9EVEvW1Jvebrr1Ge2Wwg+C+Qax8MhWCoEKjq7 4HD4zLT0SOSBg1cx3p1xWEWjYLUnyVSS0DFjqMebe3lAeN/kImUmK0M/aVCqfz7X tmtttcvMFexf7B8ZeqhfIKE1fnJVdnDjM6vSd7OVblOpHV4y0Aq02UHdHICldL5o g0vjp/BPQlttwxSzzj/SKf7FPyIfo6qx2Nu19s8rAc36dK6p2M91MBBXOxDKbsJF wLOREFmcDtfJz6yqcy0xGoAz40F/ZQtwt+fAspXM6CWJnVp3WVQ3FGMVkv+vb1YL ZJq3L4PuHYGigYpxgiva6z6/KjQebMbP4/DrJ+9u25xaai9hrVDYr7x4ng4MP2Jl ApG2R8FpxB2nFDENzjBTzQibFXv6BYHHycSSPCfSACo9krYPFYQ= =8Svs -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 09:10:50 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 14:10:50 +0000 Received: from localhost ([127.0.0.1]:37967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPTDN-0000Gc-3N for submit@debbugs.gnu.org; Wed, 21 Nov 2018 09:10:50 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:36001) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPTDK-0000G7-Uv for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 09:10:47 -0500 Received: by mail-lf1-f65.google.com with SMTP id a16so4085411lfg.3 for <33448@debbugs.gnu.org>; Wed, 21 Nov 2018 06:10:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=qOZutZN0wxrgsG+HzEGtk2sqEp5Sx+cfzEkCE/m/RVc=; b=mirh4fN1PRejxp7wYtS4pE1o9BXweDa0xRtvCdTvU/JdQESuQ12ExZumYo+cxCUydZ RiCf96XdWA5KiKg2wEBNCIlaCDBriffMGpNDMeVXZnoctc1YTXlVo0IQeZwiv13pvOc0 ZmrNVEQ/Y1qmV+sm0QaRv89AxZNQ0cVyhL1RLmrjdSSGSLxLiHLbxII1Jpc7DCSRPIOP Y+cADqN0zgxNCyXZ6ghACsw31O54iFR6OKkL9XJ/iN0GkV3O8BeHeceykuKOY2HKu77b Pj/mHXctuE5OExiXPPrFgbiFF/ViAPImTSAE+bLhfzApRT1T5ZW099YNQgC5CZbVisbY JoLg== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=qOZutZN0wxrgsG+HzEGtk2sqEp5Sx+cfzEkCE/m/RVc=; b=lSLnbUErtBf8WI6MWFHoHf3tXwZct95XupyWIBhX6yC7aDBGoLdlIFS1T0HZ2qGGy6 B0GIQ6Gd/XZUOz10UIUonFaLvXfIMGQ/i0FK9xKg4JUzMCM4Faq09+N7HzJVh7985gJ+ 633rbiqV7ILbIHlaMxlpC55R2389KO/x5OdU/usZXOUB4BRHcMOXOkDrR1as7Zc1DeJx q/A6YCt7mNusB1D137FLPmaQmSihatPKAMuNrYAdi0S0/0L3Jf95q/qLQo/ynK+6nyF7 uJfobwo1uz3/wP6JPj6aIPxiPnpMJHnjzr879+IyM0/806+zdIKA6MYpR1suZYwBqaZu 0qgA== X-Gm-Message-State: AGRZ1gLuS70pIjEhJlJo6ncmYPa171I6fl7yg39CZzjCJ1eYuw+UUMwx B6IAGsp0sc8KBGrtQENMq4B1JKleBNI= X-Google-Smtp-Source: AJdET5fjMlCZqGy+UfNNmAcOhmDDc6HSwnci+Lk/xdoKoMkx1Mhed3DgftYpA5rHmNGzXsFCfSPN0Q== X-Received: by 2002:a19:6806:: with SMTP id d6mr3775194lfc.48.1542809440363; Wed, 21 Nov 2018 06:10:40 -0800 (PST) Received: from magnolia (95-55-9-11.dynamic.avangarddsl.ru. [95.55.9.11]) by smtp.gmail.com with ESMTPSA id n8-v6sm7326745lji.90.2018.11.21.06.10.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Nov 2018 06:10:39 -0800 (PST) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#33448] [PATCH] describe: Add json format. References: <20181120222616.3941-1-go.wigust@gmail.com> <20181121070051.12041-1-go.wigust@gmail.com> <8736ruu2fn.fsf@gnu.org> Date: Wed, 21 Nov 2018 17:10:33 +0300 In-Reply-To: <8736ruu2fn.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 21 Nov 2018 11:53:32 +0100") Message-ID: <87k1l67c86.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Ludovic, Apologies for created previously separate bug reports of same patch series. ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Oleg Pykhalov skribis: > >> * guix/scripts/describe.scm: Add json format. > > Please describe the modified and added variables/procedures. > >> + (define (channels format) >> + (map (lambda (entry) >> + =E2=80=A6 >> + (generation-file-name profile number))))))) Ups, I'll do this in followign patch series. > How about turning this into a list of objects, and then, > separately have =E2=80=98channels->sexp=E2=80=99 and =E2=80=98channels->j= son=E2=80=99? That would avoid > having dealing with the format in two different places. > > Also, could you mention the new format in the manual? > > Last question: what use case do you have in mind regarding the JSON > format? I=E2=80=99m asking because we don=E2=80=99t have tools that can = consume it so > far. Well, I wanted to get a command line way to select things in =E2=80=98guix channel=E2=80=99 output, e.g. to get a current =E2=80=98guix=E2=80=99 chann= el commit: =2D-8<---------------cut here---------------start------------->8--- ./pre-inst-env guix describe --profile=3D$HOME/.config/guix/current --forma= t=3Djson | jq --raw-output 'map(select(.name =3D=3D "guix"))'[0].commit =2D-8<---------------cut here---------------end--------------->8--- I didn't think that =E2=80=98recsel=E2=80=99 actually could be used in the = same way: =2D-8<---------------cut here---------------start------------->8--- ./pre-inst-env guix describe --profile=3D$HOME/.config/guix/current --forma= t=3Drecutils | recsel -e 'name =3D "guix"' -P commit =2D-8<---------------cut here---------------end--------------->8--- I'll send new patch series following current message. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAlv1Z1kACgkQFn+OpQAa +pz7Ig//bAZ782TPlu8Bzg3ElxjYvVGr3GTYE4RFJhrd7othg04SVSZS6heYtbwn OwvBxldxGNttbdf24kgutzDzyCRmV5r5EOlt9x44rMTU3ivKxBdihx4lem9PW7tM 5ohcf3kWxpbS5cM+Ox7cvYbOOSZFrEn/p3WUZ64dJ8cGuTlN+IqxoZbC5dYOcJvx +awfx7vXJiMHaa079Ix/yY6pSefJ2UkQ2jZUbNsAl8i2f8aDuxk5789Q148xT5J4 7rRUZPcx21gJ6gBOZaBve4njOouEaffGVxVLpBILiVShWUdpDYsiP4JExrvIwo7M vTgeAXfvWf0D2Ph/yxq8Va93UJf0ECl+KFnUjrAjMDv0JgsBD2HmbOaFXPPWBcJu aBMrea13Kvi3YJnUzIGx8LsHG0Wh+rCPryslsHVlKFHGkZJ0qaT4FflVJCWi5FeJ uQeb5Ywns1nUZWn97gH77Y6IPPvwcoaeX0Vu2JGpyzC35VQFBTXKwvJJZd4k/EE6 FFeUtYanxSmSLQ5DvM4UI7rnvMYT4XmJw+MP1csixmOpbnmpFxR49tieYH3vnfjM EZ6tz/lHlbt4rkqhClB0rrsfqXSNJDEneYDLSIfrCViP1vgnez5OTCzgi55D5KF+ 07o1C08pjtB9vdXH9blIWLp2kD3dr2cCix2rQJdkVwX1KflvnLY= =vqpi -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 09:17:51 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 14:17:51 +0000 Received: from localhost ([127.0.0.1]:37981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPTKA-0000fA-QD for submit@debbugs.gnu.org; Wed, 21 Nov 2018 09:17:51 -0500 Received: from mail-lf1-f50.google.com ([209.85.167.50]:39459) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPTK8-0000ea-Hw for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 09:17:49 -0500 Received: by mail-lf1-f50.google.com with SMTP id n18so4095198lfh.6 for <33448@debbugs.gnu.org>; Wed, 21 Nov 2018 06:17:48 -0800 (PST) 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=zZMonOlYz2OWHfhukf+S/MLam9zDDMLR67q42X9YMTE=; b=SXouQuw++Whgf2GmDi4JGmo6ifQAUrCt9l7EcQrdu0W7g4SHRQe1n9nvOp/pQmuIGG KwWpsGloRsvl531z/Y1AJmeTg/kuLtWY3U9Ro79PevRHqQu6k4zQXe5Hxi0EAvOnTxYN RDzz7NS+lDAMWLwbKq2QlE7E5rZSKbi/T7iAk+3BaKBxGO1nbqqyBPMsSFR0CJzIS4cd /PiNKdPgXFAwzBTgaZv8pwMzPuGD1rgj5dz6LoUPRUz67y8uYdodXcuGuWi1WEMsx+xh hiCo3gfCqY8Ig+ZQ++V4V6O4UacxGstN+hQXGXDDCQzqWyLENztb5RVpabdU9c5TgaM3 S1gg== 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=zZMonOlYz2OWHfhukf+S/MLam9zDDMLR67q42X9YMTE=; b=oZ8p1AjP3qvTowu2D98M4pfu4JkURv+ddbw8+tba/lyTGBKsYWBJnIB6OkkmKkYfai pafeUMli/68EgJOFCzQUhSxz0GjVxq6YE+J8kI4atGLULfKypLw/CzPUy7Shc2uLHjnH 4NbE6XiLsWsrZjBvKC0uppiwphdLuIRAWIOQHEc4EZLDlXppC8UMSbiTvphZsRU0KPGl IZoTfU6yYaQNhLyUfFxpvXgCmyeL9UI39yhMOIuXloBTyiN8wv+0ST+VLcfCUD/lVjL/ /8wk6ZVXhIktpdikV60HS2WRcaVy/siXgxUzJ+93ib4kxOMf153rIr0eGyhiIKgNjRCs tSFQ== X-Gm-Message-State: AGRZ1gIqLDR0IRS0JpjqnjKF+RcZpTkgfa9z0O86Qpv8NVGQpekZ/VYz dhW4VEdaW2+Ia+vPAdukdAhacRAi+IU= X-Google-Smtp-Source: AJdET5dZupp8fOpr+7s2VPtV4n9OA2iYNj3YQEwjFbLbsrJoceCQ/f+V73zowFEbTFwVcGQ1B0/DUw== X-Received: by 2002:a19:2c92:: with SMTP id s140mr3759047lfs.42.1542809862273; Wed, 21 Nov 2018 06:17:42 -0800 (PST) Received: from localhost.localdomain (95-55-9-11.dynamic.avangarddsl.ru. [95.55.9.11]) by smtp.gmail.com with ESMTPSA id k3-v6sm1589040lja.8.2018.11.21.06.17.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 06:17:41 -0800 (PST) From: Oleg Pykhalov To: 33448@debbugs.gnu.org Subject: [PATCH 1/3] describe: Use a procedure to format output. Date: Wed, 21 Nov 2018 17:17:13 +0300 Message-Id: <20181121141715.16417-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33448 Cc: Oleg Pykhalov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * guix/channels.scm (channel->sexp): New procedure. * guix/scripts/describe.scm (display-checkout-info, display-profile-info): Use this. --- guix/channels.scm | 9 +++++++ guix/scripts/describe.scm | 57 ++++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/guix/channels.scm b/guix/channels.scm index 82389eb58..bfdbf470b 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -39,6 +39,7 @@ channel-commit channel-location + channel->sexp %default-channels channel-instance? @@ -85,6 +86,14 @@ "Return true if CHANNEL is the 'guix' channel." (eq? 'guix (channel-name channel))) +(define channel->sexp + (match-lambda + (($ name url branch commit location) + `(channel + (name ,name) + (url ,url) + (commit ,commit))))) + (define-record-type (channel-instance channel commit checkout) channel-instance? diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm index d817d7f7c..6a30d19b1 100644 --- a/guix/scripts/describe.scm +++ b/guix/scripts/describe.scm @@ -18,6 +18,7 @@ (define-module (guix scripts describe) #:use-module ((guix ui) #:hide (display-profile-content)) + #:use-module (guix channels) #:use-module (guix scripts) #:use-module (guix describe) #:use-module (guix profiles) @@ -104,10 +105,9 @@ within a Git checkout." (format #t (G_ " branch: ~a~%") (reference-shorthand head)) (format #t (G_ " commit: ~a~%") commit)) ('channels - (pretty-print `(list (channel - (name 'guix) - (url ,(dirname directory)) - (commit ,commit)))))) + (pretty-print (channel->sexp (channel (name 'guix) + (url (dirname directory)) + (commit commit)))))) (display-package-search-path fmt))) (define (display-profile-info profile fmt) @@ -116,34 +116,35 @@ in the format specified by FMT." (define number (generation-number profile)) + (define (channels) + (map (lambda (entry) + (match (assq 'source (manifest-entry-properties entry)) + (('source ('repository ('version 0) + ('url url) + ('branch branch) + ('commit commit) + _ ...)) + (channel (name (string->symbol (manifest-entry-name entry))) + (url url) + (commit commit))) + + ;; Pre-0.15.0 Guix does not provide that information, + ;; so there's not much we can do in that case. + (_ '???))) + + ;; Show most recently installed packages last. + (reverse + (manifest-entries + (profile-manifest + (if (zero? number) + profile + (generation-file-name profile number))))))) + (match fmt ('human (display-profile-content profile number)) ('channels - (pretty-print - `(list ,@(map (lambda (entry) - (match (assq 'source (manifest-entry-properties entry)) - (('source ('repository ('version 0) - ('url url) - ('branch branch) - ('commit commit) - _ ...)) - `(channel (name ',(string->symbol - (manifest-entry-name entry))) - (url ,url) - (commit ,commit))) - - ;; Pre-0.15.0 Guix does not provide that information, - ;; so there's not much we can do in that case. - (_ '???))) - - ;; Show most recently installed packages last. - (reverse - (manifest-entries - (profile-manifest - (if (zero? number) - profile - (generation-file-name profile number)))))))))) + (pretty-print (map channel->sexp (channels))))) (display-package-search-path fmt)) -- 2.19.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 09:17:53 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 14:17:53 +0000 Received: from localhost ([127.0.0.1]:37984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPTKD-0000fT-95 for submit@debbugs.gnu.org; Wed, 21 Nov 2018 09:17:53 -0500 Received: from mail-lj1-f176.google.com ([209.85.208.176]:44141) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPTK9-0000ef-UX for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 09:17:50 -0500 Received: by mail-lj1-f176.google.com with SMTP id k19-v6so4952417lji.11 for <33448@debbugs.gnu.org>; Wed, 21 Nov 2018 06:17:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KJW9fjfUR7H2gBddt0ifGttS/FYQn+6GY9MjbUkpwoo=; b=SLsV5h99r52tfg/bZxtjeMUNKZUlTBdvlQfmE0hggWf0JWU/Iz0zhmu21B7Kw/qvXB NsLjwbpMX4cnaAuJpiGTSZp4uKi5qeTsXAkc4Uq1FvnwuCTTh1/HaGAfilyEVI1tDmS/ 45pki1zX+pZkyZjrnXq/WMVUh3T5wQqCDl6RXWm1uu77cfxlhJCzJHeBzE/NGgVX0tSX Fza/WcsRG5SaWw0x3RECtQxwDVlgs5+rfvTCbzu6Vc/IxqMQHoCEh6SYdRtdvDrra5hs b/96euBzn86Gy9tPnvS2E+bZ7dcVLhSN2mxpe9LcxuB1bUxW7bEvxyRXxjgmZY/x2Xb2 NjuQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=KJW9fjfUR7H2gBddt0ifGttS/FYQn+6GY9MjbUkpwoo=; b=bZ3N1N6aBF6RykOlrIr8R4GFULiQ0SQaNr4BuYi1fEkH5Zn+H4EJBQSsvnjAJDEvGH mAjMHEI2Yn6E0LuAESLKf1p1mKlhLuAvu2KmJNENbvX5kahUBwofd5Y9NB9+0KODBFLC a+aNHAegnyl15MatXKRsm3CHzDIbl8n2QMIZ0S6DUVFRJ/9FNmDR6mkEX/SZLx3brdZt irJ9UrRm81WqBDsiXzYrV+1h0kximAxcZtMh4Lou1oYTTl6PJ1sVN1//5tITSDkDwDCb ZgH6APRz9mQZqabXjKCX6U3HY4DrEwFsyoIWqVvrdr94gI20nYNVz1RF5ygxMG28rq2S AYjA== X-Gm-Message-State: AGRZ1gJ78uJHCOG0wxUrBmxlc1VkaTdtxbtB8q80PIAqSHMxUw2kEMQy 22ajbbrMuF33qZzEUStvVAaq42uIc18= X-Google-Smtp-Source: AJdET5dE73Yq15icN+bCDdJcWr6i4eUG+BfdLS95TOk33HiQQM1XaKLhm+KnLJd0+51AyE9kCM0dtw== X-Received: by 2002:a2e:9059:: with SMTP id n25-v6mr4138151ljg.155.1542809863628; Wed, 21 Nov 2018 06:17:43 -0800 (PST) Received: from localhost.localdomain (95-55-9-11.dynamic.avangarddsl.ru. [95.55.9.11]) by smtp.gmail.com with ESMTPSA id k3-v6sm1589040lja.8.2018.11.21.06.17.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 06:17:42 -0800 (PST) From: Oleg Pykhalov To: 33448@debbugs.gnu.org Subject: [PATCH 2/3] describe: Add json format. Date: Wed, 21 Nov 2018 17:17:14 +0300 Message-Id: <20181121141715.16417-2-go.wigust@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181121141715.16417-1-go.wigust@gmail.com> References: <20181121141715.16417-1-go.wigust@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33448 Cc: Oleg Pykhalov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * guix/channels.scm (channel->json): New procedure. * guix/scripts/describe.scm (%options): Add 'json' option. (display-checkout-info, display-profile-info): Use 'channel->json'. * doc/guix.texi (Invoking guix describe): Document this. --- doc/guix.texi | 5 ++++- guix/channels.scm | 12 ++++++++++++ guix/scripts/describe.scm | 13 ++++++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 082e81bf7..3413eb30f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3273,7 +3273,10 @@ produce human-readable output; @item channels produce a list of channel specifications that can be passed to @command{guix pull -C} or installed as @file{~/.config/guix/channels.scm} (@pxref{Invoking -guix pull}). +guix pull}); +@item json +@cindex JSON +produce a list of channel specifications in JSON format. @end table @item --profile=@var{profile} diff --git a/guix/channels.scm b/guix/channels.scm index bfdbf470b..9f2c9103e 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -26,6 +26,7 @@ #:use-module (guix derivations) #:use-module (guix store) #:use-module (guix i18n) + #:use-module (json) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (srfi srfi-11) @@ -39,7 +40,9 @@ channel-commit channel-location + channel->json channel->sexp + %default-channels channel-instance? @@ -94,6 +97,15 @@ (url ,url) (commit ,commit))))) +(define channel->json + (match-lambda + (($ name url branch commit location) + (scm->json-string + (list + (cons 'name name) + (cons 'url url) + (cons 'commit commit)))))) + (define-record-type (channel-instance channel commit checkout) channel-instance? diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm index 6a30d19b1..d7e276769 100644 --- a/guix/scripts/describe.scm +++ b/guix/scripts/describe.scm @@ -39,7 +39,7 @@ ;; Specifications of the command-line options. (list (option '(#\f "format") #t #f (lambda (opt name arg result) - (unless (member arg '("human" "channels")) + (unless (member arg '("human" "channels" "json")) (leave (G_ "~a: unsupported output format~%") arg)) (alist-cons 'format (string->symbol arg) result))) (option '(#\p "profile") #t #f @@ -107,7 +107,12 @@ within a Git checkout." ('channels (pretty-print (channel->sexp (channel (name 'guix) (url (dirname directory)) - (commit commit)))))) + (commit commit))))) + ('json + (display (channel->json (channel (name 'guix) + (url (dirname directory)) + (commit commit)))) + (newline))) (display-package-search-path fmt))) (define (display-profile-info profile fmt) @@ -144,7 +149,9 @@ in the format specified by FMT." ('human (display-profile-content profile number)) ('channels - (pretty-print (map channel->sexp (channels))))) + (pretty-print (map channel->sexp (channels)))) + ('json + (format #t "[~a]~%" (string-join (map channel->json (channels)) ",")))) (display-package-search-path fmt)) -- 2.19.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 09:17:53 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 14:17:54 +0000 Received: from localhost ([127.0.0.1]:37986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPTKD-0000fX-Kn for submit@debbugs.gnu.org; Wed, 21 Nov 2018 09:17:53 -0500 Received: from mail-lf1-f51.google.com ([209.85.167.51]:42982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPTKB-0000ek-1X for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 09:17:51 -0500 Received: by mail-lf1-f51.google.com with SMTP id l10so4090422lfh.9 for <33448@debbugs.gnu.org>; Wed, 21 Nov 2018 06:17:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n0qeXb+nBA9ijI40pzn7RRvQDja5vhIrR1uJHWBCpcU=; b=GjVjTQrY4/OcBKZGMzt3rgJgpouweqHCnM+XtSLEmpKri9VFQNDFbGaUzb3FwbRaKt RvbQRkLAcIFQMjbnAfT/7ycPqcKt7IhafkHacXvYDcE1BSdOfdYwkLK/kCt+diz2WbWM mlCo1+2M37YIyvtJrTp5hBPfyhFE0NCmNvsDa+UrRRA0vCLmHtC10e9eGn7JRraWtmSD 7ukx+hU2phghHZqWCf5aw5FM/5KVPK0QTyul7GuXGkBttBsH8KpUBXQQqn4OPAaHE5KI arefUyd80StDuPTSel7RE8HeRs2GwBwhb3zhDtSF4wQm0Yrh4TIx0duY2S6NBi9kgynu fSug== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=n0qeXb+nBA9ijI40pzn7RRvQDja5vhIrR1uJHWBCpcU=; b=ozOlYHRh6tzcR3R5h+sSytmz2223D1MrofugxmsGsM0VtJdtvFb6bQvuEZt87OvTx8 daseJbAfXaEOr86oy45MWu2stSuytZ8eGOjOglKBA9UeiKsDhcX2Akr1cyLQGVbIOcUm pbLB88h4rU7glWM5+WoS01J+hqeU/9JIdDWxbIZRn0YCiA1+dRvk83sd7XXqW/m9LGVA 37X/g3feMnKBBvl5CEDjwC2frKqGsIPdnVBselDLGQWwajmMitsXy37OvYHw/9Xm0OLv xqoo7mITIWvPrCULW5xXEY0J2z/TgUX9JYNhB4X5VzlJ2hB8zo7DbRPDXv/o3xvrD2Sl vSpw== X-Gm-Message-State: AGRZ1gI8a4jSMdNh8kc9ZfOKMXoyjskqUhgIFeQNQMmgVwUJpXQezMmz eXITyISR+7aGRoHHglklkBPTcyWDeyk= X-Google-Smtp-Source: AJdET5d81b59/+/Sq3Q55576euUbf5ylK7tZvR34T2GSvy4UubwfVqeQ8NHSwn6x5ruLFYnRTxxITQ== X-Received: by 2002:a19:4f0c:: with SMTP id d12mr3761277lfb.121.1542809864924; Wed, 21 Nov 2018 06:17:44 -0800 (PST) Received: from localhost.localdomain (95-55-9-11.dynamic.avangarddsl.ru. [95.55.9.11]) by smtp.gmail.com with ESMTPSA id k3-v6sm1589040lja.8.2018.11.21.06.17.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 06:17:43 -0800 (PST) From: Oleg Pykhalov To: 33448@debbugs.gnu.org Subject: [PATCH 3/3] describe: Add recutils format. Date: Wed, 21 Nov 2018 17:17:15 +0300 Message-Id: <20181121141715.16417-3-go.wigust@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181121141715.16417-1-go.wigust@gmail.com> References: <20181121141715.16417-1-go.wigust@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33448 Cc: Oleg Pykhalov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * guix/channels.scm (channel->recutils): New procedure. * guix/scripts/describe.scm (%options): Add 'recutils' option. (display-checkout-info, display-profile-info): Use 'channel->recutils'. * doc/guix.texi (Invoking guix describe): Document this. --- doc/guix.texi | 4 +++- guix/channels.scm | 8 ++++++++ guix/scripts/describe.scm | 18 +++++++++++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 3413eb30f..44594d168 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3276,7 +3276,9 @@ pull -C} or installed as @file{~/.config/guix/channels.scm} (@pxref{Invoking guix pull}); @item json @cindex JSON -produce a list of channel specifications in JSON format. +produce a list of channel specifications in JSON format; +@item recutils +produce a list of channel specifications in Recutils format. @end table @item --profile=@var{profile} diff --git a/guix/channels.scm b/guix/channels.scm index 9f2c9103e..ed9bc67c3 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -41,6 +41,7 @@ channel-location channel->json + channel->recutils channel->sexp %default-channels @@ -106,6 +107,13 @@ (cons 'url url) (cons 'commit commit)))))) +(define (channel->recutils c port) + (match c + (($ name url branch commit location) + (format port "name: ~a~%" name) + (format port "url: ~a~%" url) + (format port "commit: ~a~%" commit)))) + (define-record-type (channel-instance channel commit checkout) channel-instance? diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm index d7e276769..90365b7ae 100644 --- a/guix/scripts/describe.scm +++ b/guix/scripts/describe.scm @@ -39,7 +39,7 @@ ;; Specifications of the command-line options. (list (option '(#\f "format") #t #f (lambda (opt name arg result) - (unless (member arg '("human" "channels" "json")) + (unless (member arg '("human" "channels" "json" "recutils")) (leave (G_ "~a: unsupported output format~%") arg)) (alist-cons 'format (string->symbol arg) result))) (option '(#\p "profile") #t #f @@ -112,7 +112,12 @@ within a Git checkout." (display (channel->json (channel (name 'guix) (url (dirname directory)) (commit commit)))) - (newline))) + (newline)) + ('recutils + (channel->recutils (channel (name 'guix) + (url (dirname directory)) + (commit commit)) + #t))) (display-package-search-path fmt))) (define (display-profile-info profile fmt) @@ -151,7 +156,14 @@ in the format specified by FMT." ('channels (pretty-print (map channel->sexp (channels)))) ('json - (format #t "[~a]~%" (string-join (map channel->json (channels)) ",")))) + (format #t "[~a]~%" (string-join (map channel->json (channels)) ","))) + ('recutils + (format #t "~{~a~%~}" + (map (lambda (channel) + (with-output-to-string + (lambda () + (channel->recutils channel (current-output-port))))) + (channels))))) (display-package-search-path fmt)) -- 2.19.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 16:31:40 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 21:31:40 +0000 Received: from localhost ([127.0.0.1]:40246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPa60-0002wh-GT for submit@debbugs.gnu.org; Wed, 21 Nov 2018 16:31:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPa5x-0002wV-Te for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 16:31:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPa5s-0004AO-1T for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 16:31:32 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPa5r-0004AK-TZ; Wed, 21 Nov 2018 16:31:31 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=33256 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gPa5r-0000g4-JW; Wed, 21 Nov 2018 16:31:31 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#33448] [PATCH 1/3] describe: Use a procedure to format output. References: <20181120222616.3941-1-go.wigust@gmail.com> <20181121141715.16417-1-go.wigust@gmail.com> Date: Wed, 21 Nov 2018 22:31:29 +0100 In-Reply-To: <20181121141715.16417-1-go.wigust@gmail.com> (Oleg Pykhalov's message of "Wed, 21 Nov 2018 17:17:13 +0300") Message-ID: <87lg5mruby.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Hi, Oleg Pykhalov skribis: > * guix/channels.scm (channel->sexp): New procedure. > * guix/scripts/describe.scm (display-checkout-info, display-profile-info)= : Use > this. [...] > + (define (channels) s/define (channels)/define channels/ :-) > + (map (lambda (entry) > + (match (assq 'source (manifest-entry-properties entry)) > + (('source ('repository ('version 0) > + ('url url) > + ('branch branch) > + ('commit commit) > + _ ...)) > + (channel (name (string->symbol (manifest-entry-name entry)= )) > + (url url) > + (commit commit))) > + > + ;; Pre-0.15.0 Guix does not provide that information, > + ;; so there's not much we can do in that case. > + (_ '???))) Maybe return, say: (channel (name 'guix)(url "?")(commit "?")). This would avoid weird type errors. > + (pretty-print (map channel->sexp (channels))))) I think it should be: (pretty-print `(list ,@(map channel->sexp channels))) right? OK with these changes, thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 16:33:42 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 21:33:42 +0000 Received: from localhost ([127.0.0.1]:40250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPa7x-0002zl-UH for submit@debbugs.gnu.org; Wed, 21 Nov 2018 16:33:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPa7w-0002zZ-9X for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 16:33:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPa7q-0005cq-B0 for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 16:33:34 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPa7q-0005cZ-7p; Wed, 21 Nov 2018 16:33:34 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49656 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gPa7q-0004Rw-0h; Wed, 21 Nov 2018 16:33:34 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#33448] [PATCH 2/3] describe: Add json format. References: <20181121141715.16417-1-go.wigust@gmail.com> <20181121141715.16417-2-go.wigust@gmail.com> Date: Wed, 21 Nov 2018 22:33:32 +0100 In-Reply-To: <20181121141715.16417-2-go.wigust@gmail.com> (Oleg Pykhalov's message of "Wed, 21 Nov 2018 17:17:14 +0300") Message-ID: <87d0qyru8j.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Oleg Pykhalov skribis: > * guix/channels.scm (channel->json): New procedure. > * guix/scripts/describe.scm (%options): Add 'json' option. > (display-checkout-info, display-profile-info): Use 'channel->json'. > * doc/guix.texi (Invoking guix describe): Document this. [...] > +(define channel->json > + (match-lambda > + (($ name url branch commit location) > + (scm->json-string > + (list > + (cons 'name name) > + (cons 'url url) > + (cons 'commit commit)))))) Since this is not a core feature of channels and add a dependency on (json), what about moving this procedure to (guix scripts describe)? (=E2=80=98channel->sexp=E2=80=99 could got to (guix scripts describe) as we= ll maybe; no big deal.) Otherwise LGTM! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 16:34:38 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 21:34:38 +0000 Received: from localhost ([127.0.0.1]:40254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPa8s-00031L-8i for submit@debbugs.gnu.org; Wed, 21 Nov 2018 16:34:38 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPa8q-000318-QZ for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 16:34:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPa8l-0006ez-6Z for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 16:34:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPa8l-0006eu-3Q; Wed, 21 Nov 2018 16:34:31 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57252 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gPa8k-0004Xl-SU; Wed, 21 Nov 2018 16:34:31 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#33448] [PATCH 3/3] describe: Add recutils format. References: <20181121141715.16417-1-go.wigust@gmail.com> <20181121141715.16417-3-go.wigust@gmail.com> Date: Wed, 21 Nov 2018 22:34:29 +0100 In-Reply-To: <20181121141715.16417-3-go.wigust@gmail.com> (Oleg Pykhalov's message of "Wed, 21 Nov 2018 17:17:15 +0300") Message-ID: <878t1mru6y.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Oleg Pykhalov skribis: > * guix/channels.scm (channel->recutils): New procedure. > * guix/scripts/describe.scm (%options): Add 'recutils' option. > (display-checkout-info, display-profile-info): Use 'channel->recutils'. > * doc/guix.texi (Invoking guix describe): Document this. [...] > +(define (channel->recutils c port) > + (match c > + (($ name url branch commit location) > + (format port "name: ~a~%" name) > + (format port "url: ~a~%" url) > + (format port "commit: ~a~%" commit)))) Same thing here: I=E2=80=99d have a preference for moving it to (guix scrip= ts describe). Otherwise LGTM, thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 16:36:10 2018 Received: (at 33448) by debbugs.gnu.org; 21 Nov 2018 21:36:10 +0000 Received: from localhost ([127.0.0.1]:40264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPaAM-000346-3G for submit@debbugs.gnu.org; Wed, 21 Nov 2018 16:36:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPaAK-00033u-Mn for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 16:36:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPaAE-0008IR-Uv for 33448@debbugs.gnu.org; Wed, 21 Nov 2018 16:36:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58300) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPaAE-0008Hw-QG; Wed, 21 Nov 2018 16:36:02 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=41232 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gPaAE-0004jS-Iz; Wed, 21 Nov 2018 16:36:02 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#33448] [PATCH] describe: Add json format. References: <20181120222616.3941-1-go.wigust@gmail.com> <20181121070051.12041-1-go.wigust@gmail.com> <8736ruu2fn.fsf@gnu.org> <87k1l67c86.fsf@gmail.com> Date: Wed, 21 Nov 2018 22:36:01 +0100 In-Reply-To: <87k1l67c86.fsf@gmail.com> (Oleg Pykhalov's message of "Wed, 21 Nov 2018 17:10:33 +0300") Message-ID: <8736ruru4e.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Oleg Pykhalov skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: [...] >> Last question: what use case do you have in mind regarding the JSON >> format? I=E2=80=99m asking because we don=E2=80=99t have tools that can= consume it so >> far. > > Well, I wanted to get a command line way to select things in =E2=80=98guix > channel=E2=80=99 output, e.g. to get a current =E2=80=98guix=E2=80=99 cha= nnel commit: > > ./pre-inst-env guix describe --profile=3D$HOME/.config/guix/current --for= mat=3Djson | jq --raw-output 'map(select(.name =3D=3D "guix"))'[0].commit > > > I didn't think that =E2=80=98recsel=E2=80=99 actually could be used in th= e same way: > > ./pre-inst-env guix describe --profile=3D$HOME/.config/guix/current --for= mat=3Drecutils | recsel -e 'name =3D "guix"' -P commit I see, that makes sense. It=E2=80=99s OK to have both JSON and recutils. Thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 22 07:54:25 2018 Received: (at 33448) by debbugs.gnu.org; 22 Nov 2018 12:54:25 +0000 Received: from localhost ([127.0.0.1]:40620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPoUz-0004iK-GB for submit@debbugs.gnu.org; Thu, 22 Nov 2018 07:54:25 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:33216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPoUx-0004i3-Nf for 33448@debbugs.gnu.org; Thu, 22 Nov 2018 07:54:24 -0500 Received: by mail-lj1-f195.google.com with SMTP id v1-v6so7913023ljd.0 for <33448@debbugs.gnu.org>; Thu, 22 Nov 2018 04:54:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=/b53iuGBbloGMGeie4gwpPpoXL+lq7xkR8pUfBEkI7w=; b=JtAtMhnDk/Bo3V8Yrw86sFoH6oewjz4BFdmdCQJxVdSMzxjAdKdn38jFjWAOzH4lBc kzVuATc6n3ztZfG+DAVjUijVYaA1qja4O3RvKdFwjzSGdqQgMsrrX6Xt1Kw97BqAe1Ul QtoxZxPSit2dln7lI6rBSkDRw5rlLiu7CMZ0TEmTTJrigTgqkdooCWycRHv4FVHM1+/U rE7x5zialJ6gix5pMmAmYeK1GeAj4UsAOxlp1sAiqkeor8PYRtyuLfCj9VM+bB1jL5aT ZViKbxPUCqtZw/dAp2MQuUsWj9OIS0W5rhnHzJNDzeS6wTmZ3gxlcUiyfdeF5Dg/uWs6 Po0Q== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=/b53iuGBbloGMGeie4gwpPpoXL+lq7xkR8pUfBEkI7w=; b=H40rQMNySru4oF7gTVnBEL3LA3bqpjFmfCba3nHOi4yLr0C0doCqI7VUsIzvlc1gbo UZpT+Cq3AaVjYKpNXgwYSxMdZip+ssu8p3ovSqdRaxDCNsKEaghbdhcfxeaJONjAR5MD Uoggc5W5C60HX53CHWwreFUb/hrGGf5sFmliQN7tPSvOz07KvbGtglWsyE5VV4TkiGOl wahiWT34Y2YC+5ZYXzrES7lpmHLH1y0me0uL1u4c1EvxWW6uiwI6V8ptU1ZFsiIQ9F1l bsZ+MoK1Foi64ge2n1Wp+jybO5KgpUV34avsbdUNYEbHhcLQEoplSacmGL+9DzjdtL7y 9f8w== X-Gm-Message-State: AA+aEWb9USkIeWZNvWdNECmr4SyrBBVlpHrBUdj4wrZynr+dbjj5LsS3 sI5dXfi3Kl/GXuZAaERIR1xN5z2+hv0= X-Google-Smtp-Source: AFSGD/WfIhHuzm/pAO00f8LEfiBszpGUze7LZYI9x8RuG5nm4+3xGO5D/Yh4VldLBjRqQeQA3TvFDw== X-Received: by 2002:a2e:4745:: with SMTP id u66-v6mr6531955lja.37.1542891257158; Thu, 22 Nov 2018 04:54:17 -0800 (PST) Received: from magnolia (92-100-251-83.dynamic.avangarddsl.ru. [92.100.251.83]) by smtp.gmail.com with ESMTPSA id z9sm7004806lfj.79.2018.11.22.04.54.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Nov 2018 04:54:16 -0800 (PST) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#33448] [PATCH 1/3] describe: Use a procedure to format output. References: <20181120222616.3941-1-go.wigust@gmail.com> <20181121141715.16417-1-go.wigust@gmail.com> <87lg5mruby.fsf@gnu.org> Date: Thu, 22 Nov 2018 15:54:12 +0300 In-Reply-To: <87lg5mruby.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 21 Nov 2018 22:31:29 +0100") Message-ID: <87sgzt5l3f.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Oleg Pykhalov skribis: > >> * guix/channels.scm (channel->sexp): New procedure. >> * guix/scripts/describe.scm (display-checkout-info, display-profile-info= ): Use >> this. [=E2=80=A6] >> + (pretty-print (map channel->sexp (channels))))) > > I think it should be: > > (pretty-print `(list ,@(map channel->sexp channels))) Ouch, =E2=80=98list=E2=80=99 in in 'display-checkout-info' should be too. = Apologies. Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAlv2pvQACgkQFn+OpQAa +pzcBg/8CroKyMRbaWc56feH2FfshanfJiLaU60lfbUr/tYkABi6qlOSyz46rqGS 5QeC4eNT/E10LHa73wE9x5y3lgPbEf9AYSsbNc87hh2O+Qvoo1uNcMoLf4ceh2nd VH/CaLukqX4Q/KfPzn+VVImuobjH6hqAvoNYMQz7eOiaj8eswbRZ1zilBpeKhP9y LXi6LenHzf9egGSnLGgzZJ1RDyg3XOvrmGI05MjlRuGwoBaVkn1s/dmTSbzhWbou ZaYboqUJsooN5Szne3g7p4bjeDTo9IYxS5Calrq4LvFjDbPrSjqn0AZnYzWQ6X+0 jBkyWA50B5ubwAzvVhbppUOXgVZC3LSogL4NTASY0ts1xx+sWjp2IoVF0Eb3+lHO VyV7kcqGpy4W78VzjOzvZb6o0TACe9TU73jSEHhTU9kTCUEnPUhhVlbex/AA0wOB 5r2GoOky5yX4lHc9uBQD10DiqwNpdl9hU2O77wYSl4JUKCSsTuGCh3zCbcHP2qSM oowzge/AhNjjKrXp2LmjMUQsll+pDo43TeW670J+69bApVIwwmG2b0C/prTbNc/W XfJyw2+IdVzWDdjffUqafKYbKsp4rptXQcJ6YCJrpk06eD3JswQABw1ArzHWqxpV EeWrYH7Aby+CGRT7mHtRPypO7WYVsYBdvwV0veexe5swGGM+Z3o= =PPVS -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 22 07:54:57 2018 Received: (at 33448) by debbugs.gnu.org; 22 Nov 2018 12:54:57 +0000 Received: from localhost ([127.0.0.1]:40623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPoVU-0004j2-Qw for submit@debbugs.gnu.org; Thu, 22 Nov 2018 07:54:57 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:40586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPoVT-0004ip-82 for 33448@debbugs.gnu.org; Thu, 22 Nov 2018 07:54:55 -0500 Received: by mail-lf1-f66.google.com with SMTP id v5so6456010lfe.7 for <33448@debbugs.gnu.org>; Thu, 22 Nov 2018 04:54:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=u0S1yx0KteBF36cqP8wJKCAVCmQ19qLkaFqiFUU6jM0=; b=T51GWzkDuU+X7eXU30GdertHYlKhfyJLEU2u0JySdFqJPJhy2WujkQOyBv/0KfQKM8 JpassK63xnqeacNwGfILr286WRVmo1hUl4AeR2ENCy93VMtUdasQiIdEsvuhGBWcHWWg 2a2q0hJqmNaFZvioI1WurFdHsyx8BZVbK/Se527U6cxU+DmqjGMBSn0wzo6/94MsjNBo mugfSyoN/VNypMuAe/8GwjZR+sKfFenW8w9feujcZuTJd142fwmDCYWpiqNl7iDsMS1/ GUvo0WDyijGbk0NlX35hBTaxWbqjEDo8HbOAPty0TyVERN6l9cW5p/bdzr80B4gIcuIq dksg== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=u0S1yx0KteBF36cqP8wJKCAVCmQ19qLkaFqiFUU6jM0=; b=tC2UOr0sWokpluR130Np8TDvH0PYOsiCDubqwAI0/HdHuXm1a3gSU6+n9P9fTt7DFx 69Dkt4NmlRZ7gNTGF/pFJw9umTtnRmlrKrS8POssFFs6qOTdYKmLcUsqDbXPXVUExyDn UA/F49l3EeS8h11pnfqnZk8YWBCeAtszDJlX26ecBhQIA+OrnP8FaCXZP3IbGr6LM5xx iD48KfDURHS0aw/W5dnkFwUDDypQUIS52L5PUqbILdvwnT2zstpv4Z6/9ba1C1aQR3CS YfPQRG8uqh6l5lJMxa6U1gfczyAYnOrf6K5NYMfeyzCXX0h7SBfEivh8EMtd+1l4W1J6 q2Fg== X-Gm-Message-State: AGRZ1gIhrvwLkcbdIi/XHqTw4j0Su76MKIWoq7RIPl4D18xX5WzobPLL 44F9lTX55ycxg8W+suzSL0a6MP11SN4= X-Google-Smtp-Source: AJdET5eaNMbOVXtLALaQg6x9qSvwWALmM9r96EVHvEeICvf6T496jfQHpLPDrkfn0mq1ajFW8rGztA== X-Received: by 2002:a19:9508:: with SMTP id x8mr6706462lfd.112.1542891288939; Thu, 22 Nov 2018 04:54:48 -0800 (PST) Received: from magnolia (92-100-251-83.dynamic.avangarddsl.ru. [92.100.251.83]) by smtp.gmail.com with ESMTPSA id e5-v6sm4895295ljj.91.2018.11.22.04.54.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Nov 2018 04:54:48 -0800 (PST) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#33448] [PATCH 2/3] describe: Add json format. References: <20181121141715.16417-1-go.wigust@gmail.com> <20181121141715.16417-2-go.wigust@gmail.com> <87d0qyru8j.fsf@gnu.org> Date: Thu, 22 Nov 2018 15:54:44 +0300 In-Reply-To: <87d0qyru8j.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 21 Nov 2018 22:33:32 +0100") Message-ID: <87r2fd5l2j.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludovic, Almost done with current patch series and only one question. ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Oleg Pykhalov skribis: > >> * guix/channels.scm (channel->json): New procedure. >> * guix/scripts/describe.scm (%options): Add 'json' option. >> (display-checkout-info, display-profile-info): Use 'channel->json'. >> * doc/guix.texi (Invoking guix describe): Document this. > > [...] > >> +(define channel->json >> + (match-lambda >> + (($ name url branch commit location) >> + (scm->json-string >> + (list >> + (cons 'name name) >> + (cons 'url url) >> + (cons 'commit commit)))))) > > Since this is not a core feature of channels and add a dependency on > (json), what about moving this procedure to (guix scripts describe)? should be exported in (guix channels) in this case. Is it OK? [=E2=80=A6] Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAlv2pxQACgkQFn+OpQAa +pxS0A/9GzghMkmQV2Vlf6vxtl6A4B/J3WmqkufP+IjyebWRJzq4nfslXgyXe94p 4hcCdBwTn9/CHWqz9ug44Fp2AefdF14avbRvqekd3itMcs493gC9331Wnk27fuWS AizseApV0NzcTJFHuGVBplasBgryMH1dzEWKhbnOqtYZZug4+l0izgziu5e+AeXX hqHb7ep/0Q6U1kXIl5skg5qW+Dudd3c+o2xBFSnqGs3DVWqE9PSuigtIbozaWhKP 78E68p0Qob2WDuDQNiMJmb9g+TjLQveO+MGXe7Lj/EH/WgmK3eJBCje3MEWOi7bq 8lPHkV4rEbsBlO3hE4VuNawgDM5195zh5zQyhEjhuqPYNyhkwjsqoh6Ve0+GMB2A O0hfOv8xk1eVCozUxp3dt3hUgk19GWp73YLWJw9eCxoj0oIPrneMArMvTt+SWevt GezsTkJMreHMyxDMgsfuLTnxjNf0me6OThQCKDHwr/EOixlLZ+fmV56dXnN3vAJt ZX6kKB22PDkI1fKWeUHIZ+hgrQCh7E6i+1JR/X5EEXi7bxncxQHhK9XPFOCayjBc mXaDf0EK5wr5SIzok6ksXVr1tmlOdIr+Uy+SNXbx9DkHo78Yr0xSf0qmk3e9Mfz+ zsZt2SJ/uGBqt35fizdHDvZHZqPOQfWwNvJYNmxgrcR6dvhSY5w= =8iHB -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 22 11:53:19 2018 Received: (at 33448) by debbugs.gnu.org; 22 Nov 2018 16:53:19 +0000 Received: from localhost ([127.0.0.1]:42575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPsEA-0002ax-Ql for submit@debbugs.gnu.org; Thu, 22 Nov 2018 11:53:18 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPsE8-0002ag-UA for 33448@debbugs.gnu.org; Thu, 22 Nov 2018 11:53:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPsE1-0008T0-Ol for 33448@debbugs.gnu.org; Thu, 22 Nov 2018 11:53:11 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPsE0-0008SD-Gi; Thu, 22 Nov 2018 11:53:09 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=48698 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gPsE0-0003uC-60; Thu, 22 Nov 2018 11:53:08 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#33448] [PATCH 2/3] describe: Add json format. References: <20181121141715.16417-1-go.wigust@gmail.com> <20181121141715.16417-2-go.wigust@gmail.com> <87d0qyru8j.fsf@gnu.org> <87r2fd5l2j.fsf@gmail.com> Date: Thu, 22 Nov 2018 17:53:05 +0100 In-Reply-To: <87r2fd5l2j.fsf@gmail.com> (Oleg Pykhalov's message of "Thu, 22 Nov 2018 15:54:44 +0300") Message-ID: <87h8g9awb2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Hi Oleg, Oleg Pykhalov skribis: > Almost done with current patch series and only one question. > > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Oleg Pykhalov skribis: >> >>> * guix/channels.scm (channel->json): New procedure. >>> * guix/scripts/describe.scm (%options): Add 'json' option. >>> (display-checkout-info, display-profile-info): Use 'channel->json'. >>> * doc/guix.texi (Invoking guix describe): Document this. >> >> [...] >> >>> +(define channel->json >>> + (match-lambda >>> + (($ name url branch commit location) >>> + (scm->json-string >>> + (list >>> + (cons 'name name) >>> + (cons 'url url) >>> + (cons 'commit commit)))))) >> >> Since this is not a core feature of channels and add a dependency on >> (json), what about moving this procedure to (guix scripts describe)? > > should be exported in (guix channels) in this case. Is it OK? No I think we should avoid exporting , but anyway we can write this procedure as: (lambda (channel) (scm->json-string `((name . ,(channel-name channel)) =E2=80=A6))) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 22 13:23:22 2018 Received: (at 33448) by debbugs.gnu.org; 22 Nov 2018 18:23:22 +0000 Received: from localhost ([127.0.0.1]:42625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPtdJ-00051I-MO for submit@debbugs.gnu.org; Thu, 22 Nov 2018 13:23:21 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPtdF-00050t-AT; Thu, 22 Nov 2018 13:23:17 -0500 Received: by mail-lf1-f66.google.com with SMTP id p6so7124472lfc.1; Thu, 22 Nov 2018 10:23:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=SH4OOyTEafreQ/Iu2VEU/+uhvjybeeXL4kEr4Hd5g5c=; b=ZSvK8p9c0Jiwt2yoLSC7dfMBGSag5QIKwwhfGjDdx7B1Rtjpw5cmHnr0WakOhiJUMt VlvfPrCWbIjGBIF6B9A9/uQLvPGFWP+3oFQCZXyYa2DFPRP42q6T2LfAnnzzUZcp6rRs naL4K9qvK//nczReGtZf33+tQS/PZMAcuoWFahXgQgzjoOCW8ZLnPW+zhg3TcO7J5KKW ol0olEZEMdfYRGXiIdIrGtRaD9W18yvCCEPR2PLCXEXxuhwsdPMsriMqkxulDbz1/wuR EelOZqeSBWrHOZ07x6FKa7Dl+6cnei7IJE9+H2q3ITiS30ekQsEmrs9YBX6fXcDKLxRZ knyw== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=SH4OOyTEafreQ/Iu2VEU/+uhvjybeeXL4kEr4Hd5g5c=; b=txDzHJA7CiHPK+x/vyjmOdS9jS3w5LEqiy1M5Gx8VM2hLqYICW62KJHMHtbMPwUqEH IGQsx7KkTKCL6BqvCsjs3yrskTMcoLsC9Jx6wamSA54VS5W9UxQxl144DXpyB1fGPNAm wJK350bACaqo9b9z3Ri1ZoVYL+NyhRNUB/hBvDjyQg7ZbA+nWBmTxEG5nizaix71k+Yy FkNp/XrRS3dTI6t8pseBknMb2AJyvRJi+PsrKHmOfMCH5fqOmLOqHDlGXPYrNxNAo44K w2eVVunpD5CrCJbmYy4l7z6qSpdhpbFl0MixJGvz1SF3Nx2BJP3I8J3/w/XZZQEf2Hp6 tIMA== X-Gm-Message-State: AGRZ1gLFgK0OOvAjG8w2Qo9vTs+ITGNEn3Qc0qW8qBkycZcwBmMYUs5M HcceDTvqUYLmp5Km77O8UIiX2pyGAqo= X-Google-Smtp-Source: AJdET5coC0xSkIvz5wA8Ayp6fruidQCxDnuNDk5ciRGv9Pc2KKDtizE3tYKaw/Mg0m9BlltuVCd+NQ== X-Received: by 2002:a19:2395:: with SMTP id j143mr6969872lfj.107.1542910990959; Thu, 22 Nov 2018 10:23:10 -0800 (PST) Received: from magnolia (92-100-251-83.dynamic.avangarddsl.ru. [92.100.251.83]) by smtp.gmail.com with ESMTPSA id s20sm7159027lfb.51.2018.11.22.10.23.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Nov 2018 10:23:09 -0800 (PST) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#33448] [PATCH 2/3] describe: Add json format. References: <20181121141715.16417-1-go.wigust@gmail.com> <20181121141715.16417-2-go.wigust@gmail.com> <87d0qyru8j.fsf@gnu.org> <87r2fd5l2j.fsf@gmail.com> <87h8g9awb2.fsf@gnu.org> Date: Thu, 22 Nov 2018 21:23:06 +0300 In-Reply-To: <87h8g9awb2.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 22 Nov 2018 17:53:05 +0100") Message-ID: <874lc955v9.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33448 Cc: 33448@debbugs.gnu.org, 33448-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) writes: [=E2=80=A6] >> should be exported in (guix channels) in this case. Is it OK? > > No I think we should avoid exporting , but anyway we can write > this procedure as: > > (lambda (channel) > (scm->json-string `((name . ,(channel-name channel)) =E2=80=A6))) Oh, sure. Thank you for a reminder. Pushed as: =2D-8<---------------cut here---------------start------------->8--- 85e9c4b91990008f2b6b07c5de6f14427d7c3a06 describe: Add recutils format. 81a40ee0cb925bc39e3044bddcfdd38ddb04f04d describe: Add json format. 8548f995494d8d6358e6a8d7bc3b3bb5a0cbecb5 describe: Use a procedure to forma= t output. =2D-8<---------------cut here---------------end--------------->8--- Thanks, Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAlv29AoACgkQFn+OpQAa +pzDkA//Znqr42CnfUemI7v6/nEjISCSWWaDj/Vln36J3cDu0s91sm2eCvdY8wal xcsRYc2Q9B5WC/uDRYKVfQEj4g0RhYs4gkPUs0xzPuTDu1XNjA0DBjoJvzfkwfxJ Gkm3j6cwiZ+3ORruExmgT+wqdEkOaDk8shyOawP8LC0wGF/qehD9s9xnjU8mOVt1 vbXOTVBmoy0dg/j3IEzskeFF4K8bPdZ0tEzsm/+viK/gjgb8Cl6C4fJTxPDgqtka 4dgfMjFxh7ixMQbZL18pNko0VivXz/iSx+SiES1AcLYVHcSab0rfZ+OUjhNa36HF U3+VCSWNcH0Rb/DoV0plre8X5imKIRWFSMZB3IOr8BbrHgRURxlilQndLjewPpqm Brg0TAkMj1p7UIxPnH0PL0CsaMS7kYO87puCxYInHzVs5kxfuWKeT+SjwXs+gcOS ecdmIw1UDP06oK5YmUhxJv6cqTwKqO8mE8dyiYZR+xcuGqFjNVHc4DEiIPGt2Z5s pRLm6Kl57G9bfox0K0EsjWbHlojEBv+AqUZtEsd64DJwPGyfk5d1ayLbEdJ+bLmO 4CPuG8NXBmryh2M1zW0jKRftWSKxc2bkTBicYb5WMKte0cFr2p6rDX+e3p22GVxJ C1LwMH/roFQkgMMwiBnXeVzRLsn0kSqMiqAUBJKnTRITH6uR3P4= =1tlG -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Jun 17 20:30:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 21 Dec 2018 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator