Subject: bug#33286: closed (Re: bug#33286: Add 'list-formats' to 'guix pack')

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 13 Jul 2021 12:04:02 +0000

Your bug report

#33286: Add 'list-formats' to 'guix pack'

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
33286: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=33286
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#33286: Add 'list-formats' to 'guix pack'
From: Maxim Cournoyer <[email-masked]>
To: Efraim Flashner <[email-masked]>
Cc: Ludovic Courtès <[email-masked]>, [email-masked]
Date: Tue, 13 Jul 2021 08:03:42 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

Efraim Flashner <[email-masked]> writes:

> On Tue, Nov 06, 2018 at 04:31:59PM +0100, Ludovic Courtès wrote:
>> Hello,
>> 
>> Efraim Flashner <[email-masked]> skribis:
>> 
>> > From af9a132a662f1d703df1c32278a45d2adca146ed Mon Sep 17 00:00:00 2001
>> > From: Efraim Flashner <[email-masked]>
>> > 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
>> each.
>> 
>> 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?

[...]

> I do like the idea, but I haven't been able to get it to work. In the
> mean time I've committed this as db08ea40873ae20507bc40d34a56dea1b8ce8f0e
> so we at least get the benefits of having it here.

Closing.

Thank you!

Maxim

Subject: Add 'list-formats' to 'guix pack'
From: Efraim Flashner <[email-masked]>
To: [email-masked]
Date: Tue, 6 Nov 2018 11:53:16 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

I was looking at the help menu for 'guix pack' and I realized that I
didn't know what formats were available and there wasn't a flag to show
them.

-- 
Efraim Flashner   <[email-masked]>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
From af9a132a662f1d703df1c32278a45d2adca146ed Mon Sep 17 00:00:00 2001
From: Efraim Flashner <[email-masked]>
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.
---
 guix/scripts/pack.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 83bfa4ce0..9056ada6d 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2017, 2018 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2018 Konrad Hinsen <[email-masked]>
 ;;; Copyright © 2018 Chris Marusich <[email-masked]>
+;;; Copyright © 2018 Efraim Flashner <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -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."))
+  (display (G_ "
+  docker        A tarball ready for 'docker load'."))
+  (newline))
+
 (define %options
   ;; Specifications of the command-line options.
   (cons* (option '(#\h "help") #f #f
@@ -567,6 +580,10 @@ please email '~a'~%")
          (option '(#\f "format") #t #f
                  (lambda (opt name arg result)
                    (alist-cons 'format (string->symbol arg) result)))
+         (option '("list-formats") #f #f
+                 (lambda args
+                   (show-formats)
+                   (exit 0)))
          (option '(#\R "relocatable") #f #f
                  (lambda (opt name arg result)
                    (alist-cons 'relocatable? #t result)))
@@ -621,6 +638,8 @@ Create a bundle of PACKAGE.\n"))
   (newline)
   (display (G_ "
   -f, --format=FORMAT    build a pack in the given FORMAT"))
+  (display (G_ "
+      --list-formats     list the formats available"))
   (display (G_ "
   -R, --relocatable      produce relocatable executables"))
   (display (G_ "
-- 
2.19.1