* [bug#74878] [PATCH 0/2] Improve Guix Subsitute script usage.
@ 2024-12-15 0:23 Richard Sent
2024-12-15 0:26 ` [bug#74878] [PATCH 1/2] scripts: substitute: Report the number of substitutes being updated Richard Sent
2024-12-15 0:26 ` [bug#74878] [PATCH 2/2] scripts: substitute: Improve the help output Richard Sent
0 siblings, 2 replies; 3+ messages in thread
From: Richard Sent @ 2024-12-15 0:23 UTC (permalink / raw)
To: 74878
Cc: Richard Sent, Christopher Baines, Josselin Poiret,
Ludovic Courtès, Mathieu Othacehe, Simon Tournier,
Tobias Geerinckx-Rice
Hi all,
A common question I hear is "why is guix updating substitutes so many
times". My thinking is by adding the number of substitutes being updated to
guix/scripts/substitute.scm, it might be a bit clearer that something
different is happening every time.
(This was a very "fun" adventure. Originally I used ~:*~p to refer to the
previous argument, but that emits a warning in Guile because
format-string-argument-count doesn't seem to handle ~:*. Fortunately a commit
[1] by Ludo in 2014 showed me I could use ~:p instead.)
I also tweaked the help output since I found it a bit unclear. I know it's an
internal tool, but unless I'm missing something (I very may be) the previous
help output seemed almost misleading.
Note that if anyone tests this you won't see any changes in regular guix CLI
usage unless/until the guix package proper is updated. Instead, you can use
commands like:
echo "have /gnu/store/0zahq56kff8cfrq9xhkq5wi2zdkysj6b-emacs-29.1" | guix substitute --query
[1]: 8ac39b38
Richard Sent (2):
scripts: substitute: Report the number of substitutes being updated.
scripts: substitute: Improve the help output.
guix/scripts/substitute.scm | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
base-commit: 64ac17035d66d98d3081bc7fc558c33e1be8e4f4
--
2.46.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [bug#74878] [PATCH 1/2] scripts: substitute: Report the number of substitutes being updated.
2024-12-15 0:23 [bug#74878] [PATCH 0/2] Improve Guix Subsitute script usage Richard Sent
@ 2024-12-15 0:26 ` Richard Sent
2024-12-15 0:26 ` [bug#74878] [PATCH 2/2] scripts: substitute: Improve the help output Richard Sent
1 sibling, 0 replies; 3+ messages in thread
From: Richard Sent @ 2024-12-15 0:26 UTC (permalink / raw)
To: 74878
Cc: Richard Sent, Christopher Baines, Josselin Poiret,
Ludovic Courtès, Mathieu Othacehe, Simon Tournier,
Tobias Geerinckx-Rice
* guix/scripts/substitute.scm (process-query)[make-progress-reporter]: Report
the total number of substitutes.
Change-Id: I00c6fe7383a6093ce0567c0f391e613d36a563bc
---
guix/scripts/substitute.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 8db730a9c0..08ec172675 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -328,8 +328,8 @@ (define* (process-query port command
(erase-current-line (current-error-port)) ;erase current line
(force-output (current-error-port))
(format (current-error-port)
- (G_ "updating substitutes from '~a'... ~5,1f%")
- url (* 100. (/ done total)))
+ (G_ "updating ~d substitute~:p from '~a'... ~5,1f%")
+ total url (* 100. (/ done total)))
(set! done (+ 1 done)))
(progress-reporter
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [bug#74878] [PATCH 2/2] scripts: substitute: Improve the help output.
2024-12-15 0:23 [bug#74878] [PATCH 0/2] Improve Guix Subsitute script usage Richard Sent
2024-12-15 0:26 ` [bug#74878] [PATCH 1/2] scripts: substitute: Report the number of substitutes being updated Richard Sent
@ 2024-12-15 0:26 ` Richard Sent
1 sibling, 0 replies; 3+ messages in thread
From: Richard Sent @ 2024-12-15 0:26 UTC (permalink / raw)
To: 74878
Cc: Richard Sent, Christopher Baines, Josselin Poiret,
Ludovic Courtès, Mathieu Othacehe, Simon Tournier,
Tobias Geerinckx-Rice
Clarify that arguments are read from standard input and that --query expects a
command.
* guix/scripts/substitute.scm (show-help): Reword.
Change-Id: Ifc197d5e10e43663f1e05039ce29086f6a21b943
---
guix/scripts/substitute.scm | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 08ec172675..d5c2a84c33 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -244,13 +244,16 @@ (define-syntax with-networking
(define (show-help)
(display (G_ "Usage: guix substitute OPTION [ARGUMENT]...
-Internal tool to substitute a pre-built binary to a local build.\n"))
+Internal tool to substitute a pre-built binary to a local build.
+
+ARGUMENT is read from standard input, not from the command line.\n"))
(display (G_ "
- --query report on the availability of substitutes for the
- store file names passed on the standard input"))
+ --query COMMAND STORE-FILE ...
+ Run query COMMAND with STORE-FILE to report on
+ the availability of substitutes"))
(display (G_ "
--substitute STORE-FILE DESTINATION
- download STORE-FILE and store it as a Nar in file
+ download STORE-FILE and store it as a nar in file
DESTINATION"))
(newline)
(display (G_ "
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-15 0:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-15 0:23 [bug#74878] [PATCH 0/2] Improve Guix Subsitute script usage Richard Sent
2024-12-15 0:26 ` [bug#74878] [PATCH 1/2] scripts: substitute: Report the number of substitutes being updated Richard Sent
2024-12-15 0:26 ` [bug#74878] [PATCH 2/2] scripts: substitute: Improve the help output Richard Sent
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).