Subject: [bug#33448] [PATCH 1/3] describe: Use a procedure to format output.

From: [email-masked] (Ludovic Courtès)
Date: Wed, 21 Nov 2018 22:31:29 +0100

Hi,

Oleg Pykhalov <[email-masked]> 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’.