GNU bug report logs -
#74961
[PATCH] scripts: deploy: Add the expression command line flag.
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 74961 in the body.
You can then email your comments to 74961 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org
:
bug#74961
; Package
guix-patches
.
(Thu, 19 Dec 2024 05:42:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Richard Sent <richard <at> freakingpenguin.com>
:
New bug report received and forwarded. Copy sent to
guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org
.
(Thu, 19 Dec 2024 05:42:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
* guix/scripts/deploy.scm (show-help): Add help.
(%options): Add -e and --expression.
(guix-deploy): Use expression and check for invalid flag combinations.
Change-Id: I200c9ff0c9a8c686efff4a21cd33c10429f3c73e
---
Submitting a patch to take care of https://issues.guix.gnu.org/71841.
Always struck me as odd that deploy doesn't have a --evaluate flag
like many others, so here's a go at it.
I didn't update documentation because "invoking guix deploy" still has
a TODO stating
> @c FIXME/TODO: Separate the API doc from the CLI doc.
As is there doesn't seem to be a good place to insert --expression
documentation without sidetracking the info page.
This'll be useful for me at least as I store my machine list in a
channel.
guix/scripts/deploy.scm | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
index 4b1a603049..941ee199f0 100644
--- a/guix/scripts/deploy.scm
+++ b/guix/scripts/deploy.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2019 David Thompson <davet <at> gnu.org>
;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays <at> sdf.org>
;;; Copyright © 2020-2022 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2024 Richard Sent <richard <at> freakingpenguin.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -59,6 +60,9 @@ (define (show-help)
-V, --version display version information and exit"))
(newline)
(display (G_ "
+ -e, --expression=EXPR deploy the list of machines EXPR evaluates to"))
+ (newline)
+ (display (G_ "
-x, --execute execute the following command on all the machines"))
(newline)
(display (G_ "
@@ -74,6 +78,9 @@ (define %options
(lambda args
(show-version-and-exit "guix deploy")))
+ (option '(#\e "expression") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'expression arg result)))
(option '(#\n "dry-run") #f #f
(lambda (opt name arg result)
(alist-cons 'dry-run? #t result)))
@@ -247,10 +254,16 @@ (define-command (guix-deploy . args)
(opts (parse-command-line args %options (list %default-options)
#:argument-handler handle-argument))
(file (assq-ref opts 'file))
- (machines (and file (load-source-file file)))
+ (expression (assoc-ref opts 'expression))
+ (machines (or (and file (load-source-file file))
+ (and expression (read/eval expression))))
(dry-run? (assoc-ref opts 'dry-run?))
(execute-command? (assoc-ref opts 'execute-command?)))
- (unless file
+ (when (and file expression)
+ (leave (G_ "both '--expression' and a deployment file were provided~%")))
+
+ (unless (or file
+ expression)
(leave (G_ "missing deployment file argument~%")))
(when (and (pair? command) (not execute-command?))
base-commit: 1a62f687e504c67f26693f3bc60a90e503ab4ea9
--
2.46.0
Reply sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
You have taken responsibility.
(Mon, 23 Dec 2024 17:47:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Richard Sent <richard <at> freakingpenguin.com>
:
bug acknowledged by developer.
(Mon, 23 Dec 2024 17:47:03 GMT)
Full text and
rfc822 format available.
Message #10 received at 74961-done <at> debbugs.gnu.org (full text, mbox):
Richard Sent <richard <at> freakingpenguin.com> skribis:
> * guix/scripts/deploy.scm (show-help): Add help.
> (%options): Add -e and --expression.
> (guix-deploy): Use expression and check for invalid flag combinations.
>
> Change-Id: I200c9ff0c9a8c686efff4a21cd33c10429f3c73e
Applied.
> Submitting a patch to take care of https://issues.guix.gnu.org/71841.
> Always struck me as odd that deploy doesn't have a --evaluate flag
> like many others, so here's a go at it.
>
> I didn't update documentation because "invoking guix deploy" still has
> a TODO stating
>
>> @c FIXME/TODO: Separate the API doc from the CLI doc.
>
> As is there doesn't seem to be a good place to insert --expression
> documentation without sidetracking the info page.
Yeah. We should probably move the first half of the existing material
in a “Getting Started” subsection, the second half in the “Defining
Machines” subsection, and then insert an “Invoking guix deploy”
subsection with the CLI reference somewhere. Food for thought. :-)
[...]
> + (expression (assoc-ref opts 'expression))
As a followup, it would be nice to have an ‘ensure-machine-list’ or
something, similar to how (guix scripts build) has ‘ensure-manifest’ &
co. to validate its arguments.
Thanks,
Ludo’.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 21 Jan 2025 12:24:18 GMT)
Full text and
rfc822 format available.
This bug report was last modified 143 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.