GNU bug report logs - #55577
[PATCH] Check substitute --help or --version options early

Previous Next

Package: guix-patches;

Reported by: yarl-baudig <at> mailoo.org

Date: Sun, 22 May 2022 14:23:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

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 55577 in the body.
You can then email your comments to 55577 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#55577; Package guix-patches. (Sun, 22 May 2022 14:23:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to yarl-baudig <at> mailoo.org:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 22 May 2022 14:23:01 GMT) Full text and rfc822 format available.

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

From: yarl-baudig <at> mailoo.org
To: guix-patches <at> gnu.org
Subject: [PATCH] Check substitute --help or --version options early
Date: Sun, 22 May 2022 15:54:42 +0200 (CEST)
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: earlier check for --help or --version.
---
 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 @@ (define-command (guix-substitute . args)
   (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 @@ (define reply-port
                                      #: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))))))
 
-- 
2.36.0







Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 27 May 2022 21:37:02 GMT) Full text and rfc822 format available.

Notification sent to yarl-baudig <at> mailoo.org:
bug acknowledged by developer. (Fri, 27 May 2022 21:37:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: yarl-baudig <at> mailoo.org
Cc: 55577-done <at> debbugs.gnu.org
Subject: Re: bug#55577: [PATCH] Check substitute --help or --version options
 early
Date: Fri, 27 May 2022 23:36:23 +0200
Hi,

yarl-baudig <at> mailoo.org skribis:

> 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: earlier check for --help or --version.

Applied, thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 25 Jun 2022 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 299 days ago.

Previous Next


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