[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#33448] [PATCH] describe: Add json format.

From: Oleg Pykhalov
Subject: [bug#33448] [PATCH] describe: Add json format.
Date: Wed, 21 Nov 2018 17:10:33 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hello Ludovic,

Apologies for created previously separate bug reports of same patch

address@hidden (Ludovic Courtès) writes:

> Oleg Pykhalov <address@hidden> skribis:
>> * guix/scripts/describe.scm: Add json format.
> Please describe the modified and added variables/procedures.
>> +  (define (channels format)
>> +    (map (lambda (entry)
>> +       …
>> +                (generation-file-name profile number)))))))

Ups, I'll do this in followign patch series.

> How about turning this into a list of <channel> objects, and then,
> separately have ‘channels->sexp’ and ‘channels->json’?  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’m asking because we don’t have tools that can consume it so
> far.

Well, I wanted to get a command line way to select things in ‘guix
channel’ output, e.g. to get a current ‘guix’ channel commit:
--8<---------------cut here---------------start------------->8---
./pre-inst-env guix describe --profile=$HOME/.config/guix/current --format=json 
| jq --raw-output 'map(select(.name == "guix"))'[0].commit
--8<---------------cut here---------------end--------------->8---

I didn't think that ‘recsel’ actually could be used in the same way:
--8<---------------cut here---------------start------------->8---
./pre-inst-env guix describe --profile=$HOME/.config/guix/current 
--format=recutils | recsel -e 'name = "guix"' -P commit
--8<---------------cut here---------------end--------------->8---

I'll send new patch series following current message.

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]