unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items.
@ 2020-05-26 13:38 Pierre Neidhardt
  2020-05-26 13:40 ` [bug#41539] [PATCH 2/2] doc: Add example to calculate the size a system Pierre Neidhardt
  2020-05-28 21:19 ` [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: Pierre Neidhardt @ 2020-05-26 13:38 UTC (permalink / raw)
  To: 41539

* guix/scripts/size.scm (show-help): Mention STORE-ITEM positional argument
  alternative.
---
 guix/scripts/size.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm
index 2446b84587..c42f4f7782 100644
--- a/guix/scripts/size.scm
+++ b/guix/scripts/size.scm
@@ -230,8 +230,8 @@ the name of a PNG file."
 ;;;
 
 (define (show-help)
-  (display (G_ "Usage: guix size [OPTION]... PACKAGE
-Report the size of PACKAGE and its dependencies.\n"))
+  (display (G_ "Usage: guix size [OPTION]... PACKAGE|STORE-ITEM
+Report the size of the PACKAGE or STORE-ITEM, with its dependencies.\n"))
   (display (G_ "
       --substitute-urls=URLS
                          fetch substitute from URLS if they are authorized"))
-- 
2.26.2





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#41539] [PATCH 2/2] doc: Add example to calculate the size a system.
  2020-05-26 13:38 [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items Pierre Neidhardt
@ 2020-05-26 13:40 ` Pierre Neidhardt
  2020-05-28 21:19 ` [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Pierre Neidhardt @ 2020-05-26 13:40 UTC (permalink / raw)
  To: 41539

* doc/guix.texi (Invoking `guix size'): Add guix size example for store item.
---
 doc/guix.texi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 4dbbf96db9..0c4067b52e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -10110,6 +10110,13 @@ libraries.  (That libc and GCC's libraries represent a large fraction of
 the closure is not a problem @i{per se} because they are always available
 on the system anyway.)
 
+Since the command also accepts store file names, assessing the size of
+a build result is straightforward:
+
+@example
+guix size $(guix system build config.scm)
+@end example
+
 When the package(s) passed to @command{guix size} are available in the
 store@footnote{More precisely, @command{guix size} looks for the
 @emph{ungrafted} variant of the given package(s), as returned by
-- 
2.26.2





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items.
  2020-05-26 13:38 [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items Pierre Neidhardt
  2020-05-26 13:40 ` [bug#41539] [PATCH 2/2] doc: Add example to calculate the size a system Pierre Neidhardt
@ 2020-05-28 21:19 ` Ludovic Courtès
  2020-05-29  9:25   ` Pierre Neidhardt
  1 sibling, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2020-05-28 21:19 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 41539

Hi,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> * guix/scripts/size.scm (show-help): Mention STORE-ITEM positional argument
>   alternative.

[...]

> * doc/guix.texi (Invoking `guix size'): Add guix size example for store item.

[...]

> +@example
> +guix size $(guix system build config.scm)

Please use backquotes instead of $(…), which is Bash-specific.

Otherwise LGTM, thank you!

Ludo’.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items.
  2020-05-28 21:19 ` [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items Ludovic Courtès
@ 2020-05-29  9:25   ` Pierre Neidhardt
  2020-05-29  9:56     ` zimoun
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Neidhardt @ 2020-05-29  9:25 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41539

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Pierre Neidhardt <mail@ambrevar.xyz> skribis:
>
>> * guix/scripts/size.scm (show-help): Mention STORE-ITEM positional argument
>>   alternative.
>
> [...]
>
>> * doc/guix.texi (Invoking `guix size'): Add guix size example for store item.
>
> [...]
>
>> +@example
>> +guix size $(guix system build config.scm)
>
> Please use backquotes instead of $(…), which is Bash-specific.

Actually, it's not, $(...) is POSIX (you can test with Dash).
Backquotes are deprecated and have the downside of not nesting.

> Otherwise LGTM, thank you!

OK to merge, then?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items.
  2020-05-29  9:25   ` Pierre Neidhardt
@ 2020-05-29  9:56     ` zimoun
  2020-05-29 10:09       ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: zimoun @ 2020-05-29  9:56 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 41539, Ludovic Courtès

Dear,

On Fri, 29 May 2020 at 11:26, Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> >> +@example
> >> +guix size $(guix system build config.scm)
> >
> > Please use backquotes instead of $(…), which is Bash-specific.
>
> Actually, it's not, $(...) is POSIX (you can test with Dash).
> Backquotes are deprecated and have the downside of not nesting.

Yes, $(...) is POSIX, AFAIK.
And let quote what POSIX says: "Because of these inconsistent
behaviors, the backquoted variety of command substitution is not
recommended for new applications that nest command substitutions or
attempt to embed complex scripts."

https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03

(I do not know if it is the latest version of the document.)


Well, $(...) is already used in the manual.  For example, X11 fonts
section because of nested.  But elsewhere not, see e.g., invoking guix
archive or Nteworking Services or Invoking guix system sections.

https://guix.gnu.org/manual/devel/en/guix.html#X11-Fonts
https://guix.gnu.org/manual/devel/en/guix.html#Invoking-guix-archive
https://guix.gnu.org/manual/devel/en/guix.html#Networking-Services
https://guix.gnu.org/manual/devel/en/guix.html#Invoking-guix-system

Therefore, only one should be used.  And $(...) is better.  So I would
be in favour to replace all the backquotes by $(...) in the manual.


All the best,
simon




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items.
  2020-05-29  9:56     ` zimoun
@ 2020-05-29 10:09       ` Ludovic Courtès
  2020-05-29 16:56         ` Pierre Neidhardt
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2020-05-29 10:09 UTC (permalink / raw)
  To: zimoun; +Cc: 41539, Pierre Neidhardt

Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> On Fri, 29 May 2020 at 11:26, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
>
>> >> +@example
>> >> +guix size $(guix system build config.scm)
>> >
>> > Please use backquotes instead of $(…), which is Bash-specific.
>>
>> Actually, it's not, $(...) is POSIX (you can test with Dash).
>> Backquotes are deprecated and have the downside of not nesting.
>
> Yes, $(...) is POSIX, AFAIK.
> And let quote what POSIX says: "Because of these inconsistent
> behaviors, the backquoted variety of command substitution is not
> recommended for new applications that nest command substitutions or
> attempt to embed complex scripts."
>
> https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03

I stand corrected!  That’s news to me, but definitely good news.
I’m all for using $(…) from now on.

Thank you!

Ludo’.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items.
  2020-05-29 10:09       ` Ludovic Courtès
@ 2020-05-29 16:56         ` Pierre Neidhardt
  0 siblings, 0 replies; 7+ messages in thread
From: Pierre Neidhardt @ 2020-05-29 16:56 UTC (permalink / raw)
  To: Ludovic Courtès, zimoun; +Cc: 41539

[-- Attachment #1: Type: text/plain, Size: 54 bytes --]

Merged with 776409c5069de949da328b769132fa009477668c.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-29 16:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 13:38 [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items Pierre Neidhardt
2020-05-26 13:40 ` [bug#41539] [PATCH 2/2] doc: Add example to calculate the size a system Pierre Neidhardt
2020-05-28 21:19 ` [bug#41539] [PATCH 1/2] size: Document that positional arguments can be store items Ludovic Courtès
2020-05-29  9:25   ` Pierre Neidhardt
2020-05-29  9:56     ` zimoun
2020-05-29 10:09       ` Ludovic Courtès
2020-05-29 16:56         ` Pierre Neidhardt

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).