GNU bug report logs - #33286
Add 'list-formats' to 'guix pack'

Previous Next

Package: guix-patches;

Reported by: Efraim Flashner <efraim <at> flashner.co.il>

Date: Tue, 6 Nov 2018 09:55:01 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33286 in the body.
You can then email your comments to 33286 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#33286; Package guix-patches. (Tue, 06 Nov 2018 09:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Efraim Flashner <efraim <at> flashner.co.il>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 06 Nov 2018 09:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: guix-patches <at> gnu.org
Subject: Add 'list-formats' to 'guix pack'
Date: Tue, 6 Nov 2018 11:53:16 +0200
[Message part 1 (text/plain, inline)]
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   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[0001-pack-List-the-available-formats.patch (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33286; Package guix-patches. (Tue, 06 Nov 2018 10:40:01 GMT) Full text and rfc822 format available.

Message #8 received at 33286 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 33286 <at> debbugs.gnu.org
Subject: Re: [bug#33286] Add 'list-formats' to 'guix pack'
Date: Tue, 6 Nov 2018 11:39:15 +0100
[Message part 1 (text/plain, inline)]
Hi Efraim,

On Tue, 6 Nov 2018 11:53:16 +0200
Efraim Flashner <efraim <at> flashner.co.il> wrote:

> 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.

Good idea!  In principle LGTM, but why not (also?) always show them on "--help"?
It's kinda weird to have "--help" not show something and then having to invoke a
command again to get it.  It's not like the new output is long in proportion
to the existing output of "--help" or anything.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33286; Package guix-patches. (Tue, 06 Nov 2018 10:49:03 GMT) Full text and rfc822 format available.

Message #11 received at 33286 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 33286 <at> debbugs.gnu.org
Subject: Re: [bug#33286] Add 'list-formats' to 'guix pack'
Date: Tue, 6 Nov 2018 12:48:09 +0200
[Message part 1 (text/plain, inline)]
On Tue, Nov 06, 2018 at 11:39:15AM +0100, Danny Milosavljevic wrote:
> Hi Efraim,
> 
> On Tue, 6 Nov 2018 11:53:16 +0200
> Efraim Flashner <efraim <at> flashner.co.il> wrote:
> 
> > 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.
> 
> Good idea!  In principle LGTM, but why not (also?) always show them on "--help"?
> It's kinda weird to have "--help" not show something and then having to invoke a
> command again to get it.  It's not like the new output is long in proportion
> to the existing output of "--help" or anything.

we also have 'guix refresh --list-updaters' and 'guix lint
--list-checkers'.

'guix system', for file-system-type, shows '(one of 'ext4', 'iso9660')'
right in the options.

also 'guix hash' allows other formats but doesn't have a list-updaters

having "(one of 'tarball', 'squashfs', 'docker')" would be easier, but
IMO my patch gives more information, specifically about squashfs and
needing to run 'docker load'.

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33286; Package guix-patches. (Tue, 06 Nov 2018 15:33:02 GMT) Full text and rfc822 format available.

Message #14 received at 33286 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 33286 <at> debbugs.gnu.org
Subject: Re: [bug#33286] Add 'list-formats' to 'guix pack'
Date: Tue, 06 Nov 2018 16:31:59 +0100
Hello,

Efraim Flashner <efraim <at> flashner.co.il> skribis:

> From af9a132a662f1d703df1c32278a45d2adca146ed Mon Sep 17 00:00:00 2001
> From: Efraim Flashner <efraim <at> flashner.co.il>
> 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?

You could do:

  (define-record-type <image-format>
    (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")))
        …)))

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.

WDYT?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#33286; Package guix-patches. (Tue, 27 Nov 2018 17:27:02 GMT) Full text and rfc822 format available.

Message #17 received at 33286 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 33286 <at> debbugs.gnu.org
Subject: Re: [bug#33286] Add 'list-formats' to 'guix pack'
Date: Tue, 27 Nov 2018 19:26:38 +0200
[Message part 1 (text/plain, inline)]
On Tue, Nov 06, 2018 at 04:31:59PM +0100, Ludovic Courtès wrote:
> Hello,
> 
> Efraim Flashner <efraim <at> flashner.co.il> skribis:
> 
> > From af9a132a662f1d703df1c32278a45d2adca146ed Mon Sep 17 00:00:00 2001
> > From: Efraim Flashner <efraim <at> flashner.co.il>
> > 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?
> 
> You could do:
> 
>   (define-record-type <image-format>
>     (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")))
>         …)))
> 
> 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.
> 
> WDYT?
> 
> Ludo’.

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.

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Tue, 13 Jul 2021 12:04:02 GMT) Full text and rfc822 format available.

Notification sent to Efraim Flashner <efraim <at> flashner.co.il>:
bug acknowledged by developer. (Tue, 13 Jul 2021 12:04:02 GMT) Full text and rfc822 format available.

Message #22 received at 33286-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 33286-done <at> debbugs.gnu.org
Subject: Re: bug#33286: Add 'list-formats' to 'guix pack'
Date: Tue, 13 Jul 2021 08:03:42 -0400
Hello,

Efraim Flashner <efraim <at> flashner.co.il> writes:

> On Tue, Nov 06, 2018 at 04:31:59PM +0100, Ludovic Courtès wrote:
>> Hello,
>> 
>> Efraim Flashner <efraim <at> flashner.co.il> skribis:
>> 
>> > From af9a132a662f1d703df1c32278a45d2adca146ed Mon Sep 17 00:00:00 2001
>> > From: Efraim Flashner <efraim <at> flashner.co.il>
>> > 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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 11 Aug 2021 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 230 days ago.

Previous Next


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