From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK3Mp-0006Kj-Jo for guix-patches@gnu.org; Tue, 06 Nov 2018 10:34:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gK3Mn-0002km-3B for guix-patches@gnu.org; Tue, 06 Nov 2018 10:34:11 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:33189) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gK3Li-0002NL-LA for guix-patches@gnu.org; Tue, 06 Nov 2018 10:34:08 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gK3Li-0003JD-HD for guix-patches@gnu.org; Tue, 06 Nov 2018 10:33:02 -0500 Subject: [bug#33286] Add 'list-formats' to 'guix pack' Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20181106095316.GB1206@macbook41> Date: Tue, 06 Nov 2018 16:31:59 +0100 In-Reply-To: <20181106095316.GB1206@macbook41> (Efraim Flashner's message of "Tue, 6 Nov 2018 11:53:16 +0200") Message-ID: <87lg66xlw0.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Efraim Flashner Cc: 33286@debbugs.gnu.org Hello, Efraim Flashner skribis: > From af9a132a662f1d703df1c32278a45d2adca146ed Mon Sep 17 00:00:00 2001 > From: Efraim Flashner > 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))) >=20=20 > +(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 machin= e.")) > + (display (G_ " > + squashfs A squashfs image, ready for 'cluster engines' and the li= ke.")) I=E2=80=99d write =E2=80=9CSquashfs image suitable for Singularity=E2=80=9D= and remove =E2=80=9CA=E2=80=9D from each. Also, since we have the =E2=80=98%formats=E2=80=99 alist right above, what = about adjusting it so that it contains each format description, and then =E2=80=98show-formats=E2=80=99 would just traverse it? You could do: (define-record-type (image-format proc description) image-format? (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"))) =E2=80=A6))) The dummy =E2=80=98description=E2=80=99 macro is here to allow =E2=80=98xge= ttext=E2=80=99 to catch the translatable strings without actually translating them right away; =E2=80=98show-formats=E2=80=99 will have to call =E2=80=98G_=E2=80=99 for t= hat. WDYT? Ludo=E2=80=99.