[Top][All Lists]

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

[bug#33286] Add 'list-formats' to 'guix pack'

From: Ludovic Courtès
Subject: [bug#33286] Add 'list-formats' to 'guix pack'
Date: Tue, 06 Nov 2018 16:31:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)


Efraim Flashner <address@hidden> skribis:

> From af9a132a662f1d703df1c32278a45d2adca146ed Mon Sep 17 00:00:00 2001
> From: Efraim Flashner <address@hidden>
> Date: Tue, 6 Nov 2018 11:50:48 +0200
> Subject: [PATCH] pack: List the available formats.
> * guix/scripts/pack.scm (show-formats): New variable.
> (%options, show-help): Add 'list-formats' option.


> @@ -551,6 +552,18 @@ please email '~a'~%")
>      (squashfs . ,squashfs-image)
>      (docker  . ,docker-image)))
> +(define (show-formats)
> +  ;; Print the supported pack formats.
> +  (display (G_ "The supported formats for 'guix pack' are:"))
> +  (newline)
> +  (display (G_ "
> +  tarball       A self-contained tarball, ready to run on another machine."))
> +  (display (G_ "
> +  squashfs      A squashfs image, ready for 'cluster engines' and the 
> like."))

I’d write “Squashfs image suitable for Singularity” and remove “A” from

Also, since we have the ‘%formats’ alist right above, what about
adjusting it so that it contains each format description, and then
‘show-formats’ would just traverse it?

You could do:

  (define-record-type <image-format>
    (image-format proc description)
    (proc        image-format-procedure)
    (description image-format-description))

  (define %formats
    (let-syntax ((description (syntax-rules () ((_ str) str))))
      `((tarball . ,(image-format self-contained-tarball
                                  (description "foo bar")))

The dummy ‘description’ macro is here to allow ‘xgettext’ to catch the
translatable strings without actually translating them right away;
‘show-formats’ will have to call ‘G_’ for that.



reply via email to

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