Files
fruix/tests/guix/patches/phase5-checkout-runtime.patch

79 lines
2.7 KiB
Diff

--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -37,6 +37,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (guix ui) ;import in user interfaces only
+ #:declarative? #f
#:use-module (guix i18n)
#:use-module (guix colors)
#:use-module (guix diagnostics)
@@ -562,20 +563,25 @@
(define* (show-version-and-exit #:optional (command (car (command-line))))
"Display version information for COMMAND and `(exit 0)'."
- (leave-on-EPIPE
- (simple-format #t "~a (~a) ~a~%"
- command %guix-package-name %guix-version)
- (format #t "Copyright ~a 2026 ~a"
- ;; TRANSLATORS: Translate "(C)" to the copyright symbol
- ;; (C-in-a-circle), if this symbol is available in the user's
- ;; locale. Otherwise, do not translate "(C)"; leave it as-is. */
- (G_ "(C)")
- (G_ "the Guix authors\n"))
- (display (G_"\
+ (catch 'system-error
+ (lambda ()
+ (simple-format #t "~a (~a) ~a~%"
+ command %guix-package-name %guix-version)
+ (format #t "Copyright ~a 2026 ~a"
+ ;; TRANSLATORS: Translate "(C)" to the copyright symbol
+ ;; (C-in-a-circle), if this symbol is available in the user's
+ ;; locale. Otherwise, do not translate "(C)"; leave it as-is. */
+ (G_ "(C)")
+ (G_ "the Guix authors\n"))
+ (display (G_"\
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
-")))
+")))
+ (lambda args
+ (if (= EPIPE (system-error-errno args))
+ (primitive-_exit 0)
+ (apply throw args))))
(exit 0))
(define (show-bug-report-information)
@@ -2388,7 +2394,7 @@
((or ("-h") ("--help"))
(leave-on-EPIPE (show-guix-help)))
((or ("-V") ("--version"))
- (show-version-and-exit "guix"))
+ (show-version-and-exit (basename (or (program-name) "guix"))))
(((? option? o) args ...)
(format (current-error-port)
(G_ "guix: unrecognized option '~a'~%") o)
@@ -2404,8 +2410,9 @@
args)))))
(define (guix-main arg0 . args)
- (initialize-guix)
- (apply run-guix args))
+ (parameterize ((program-name (basename arg0)))
+ (initialize-guix)
+ (apply run-guix args)))
;;; Local Variables:
;;; eval: (put 'guard* 'scheme-indent-function 2)
--- a/guix/scripts/repl.scm
+++ b/guix/scripts/repl.scm
@@ -19,6 +19,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (guix scripts repl)
+ #:declarative? #f
#:use-module (guix ui)
#:use-module (guix scripts)
#:use-module (guix repl)