[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/09: substitute: Check for --help or --version options early.
From: |
guix-commits |
Subject: |
08/09: substitute: Check for --help or --version options early. |
Date: |
Fri, 27 May 2022 18:04:05 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit d4158ea63ad6d112c3e95b3dde99608d7bd99148
Author: yarl-baudig@mailoo.org <yarl-baudig@mailoo.org>
AuthorDate: Sun May 22 15:54:42 2022 +0200
substitute: Check for --help or --version options early.
Running `guix archive --authorize` sets /etc/guix/acl to 600
via with-atomic-file-output via mkstemp!.
Then running `guix substitute --help/--version` fails on "permission
denied".
While "guix substitute" is an internal tool, the options --help and
--version
exist and you should be able to run those from the command line.
* guix/scripts/substitute.scm (guix-substitute): Earlier check for
--help or --version.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
guix/scripts/substitute.scm | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 908a8334a8..c5f5d23b47 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -704,6 +704,14 @@ default value."
(category internal)
(synopsis "implement the build daemon's substituter protocol")
+ (match args
+ ((or ("-V") ("--version"))
+ (show-version-and-exit "guix substitute"))
+ ((or ("-h") ("--help") ())
+ (show-help)
+ (exit 0))
+ (_ #t))
+
(define print-build-trace?
(match (or (find-daemon-option "untrusted-print-extended-build-trace")
(find-daemon-option "print-extended-build-trace"))
@@ -775,10 +783,6 @@ default value."
#:print-build-trace?
print-build-trace?)
(loop))))))
- ((or ("-V") ("--version"))
- (show-version-and-exit "guix substitute"))
- ((or ("-h") ("--help"))
- (show-help))
(opts
(leave (G_ "~a: unrecognized options~%") opts))))))
- branch master updated (6e9d99f97f -> cfc6bcee4c), guix-commits, 2022/05/27
- 01/09: gnu: python-peachpy: Update to 913d74c., guix-commits, 2022/05/27
- 08/09: substitute: Check for --help or --version options early.,
guix-commits <=
- 06/09: gnu: Add python-wasabi., guix-commits, 2022/05/27
- 09/09: gnu: Add python-gatt., guix-commits, 2022/05/27
- 07/09: gnu: Add python-srt., guix-commits, 2022/05/27
- 03/09: gnu: Add python-catalogue., guix-commits, 2022/05/27
- 05/09: gnu: emacs-evil-org: Update to 0d10ff7., guix-commits, 2022/05/27
- 02/09: gnu: yad: Update to 12.0., guix-commits, 2022/05/27
- 04/09: gnu: emacs-detached: Update to 0.7., guix-commits, 2022/05/27