From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPTDd-00075b-HG for guix-patches@gnu.org; Wed, 21 Nov 2018 09:11:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPTDa-0004LY-EE for guix-patches@gnu.org; Wed, 21 Nov 2018 09:11:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:33709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gPTDa-0004KR-9s for guix-patches@gnu.org; Wed, 21 Nov 2018 09:11:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gPTDZ-0000HQ-VR for guix-patches@gnu.org; Wed, 21 Nov 2018 09:11:02 -0500 Subject: [bug#33448] [PATCH] describe: Add json format. Resent-Message-ID: From: Oleg Pykhalov 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> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 33448@debbugs.gnu.org --=-=-= 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----- --=-=-=--