GNU bug report logs - #33448
[PATCH] describe: Fix 'format' option.

Previous Next

Package: guix-patches;

Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>

Date: Tue, 20 Nov 2018 22:27:01 UTC

Severity: normal

Tags: patch

Merged with 33453

Done: Oleg Pykhalov <go.wigust <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: ludo <at> gnu.org (Ludovic Courtès)
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 33448 <at> debbugs.gnu.org
Subject: [bug#33448] [PATCH] describe: Add json format.
Date: Wed, 21 Nov 2018 11:53:32 +0100
Oleg Pykhalov <go.wigust <at> gmail.com> 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 <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.

Thanks,
Ludo’.




This bug report was last modified 6 years and 179 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.