unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#57900] [PATCH]: scripts: build: Format strings before calling display-hint.
@ 2022-09-18  4:31 Zhu Zihao
  2022-09-30 13:53 ` bug#57900: " Mathieu Othacehe
  0 siblings, 1 reply; 2+ messages in thread
From: Zhu Zihao @ 2022-09-18  4:31 UTC (permalink / raw)
  To: 57900


[-- Attachment #1.1: Type: text/plain, Size: 633 bytes --]

Hi guix.

when running following command, the error message is not expected.

```
citreu@asus-laptop:~$ guix build hello --target=foobar
guix build: error: 'foobar' is not a supported cross-compilation target
hint: Try `--list-targets' to view available targets.~%

citreu@asus-laptop:~$ guix build hello --system=foobar
guix build: error: 'foobar' is not a supported system
hint: Try `--list-systems' to view available system types.~%
```

Unexpected ~% at the end of message.

In guix/scripts/build.scm, the code use display-hint to show this hint
but it doesn't format the "~%" to newline.

This patch adds these missing formats


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-scripts-build-Format-strings-before-calling-display-.patch --]
[-- Type: text/x-patch, Size: 1715 bytes --]

From 13b4f55dc1f21a8ca15329d493f441d09df0ab4e Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Sun, 18 Sep 2022 12:28:09 +0800
Subject: [PATCH] scripts: build: Format strings before calling display-hint.

* guix/scripts/build.scm(%standard-cross-build-options): format hint string.
%standard-cross-build-options: Ditto.
---
 guix/scripts/build.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 06d9ad1f0c..0787dfcc9a 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -383,8 +383,9 @@ (define %standard-cross-build-options
                           (format #f (G_ "Did you mean @code{~a}?
 Try @option{--list-targets} to view available targets.~%")
                                   closest))
-                         (display-hint (G_ "\
-Try @option{--list-targets} to view available targets.~%")))
+                         (display-hint
+                          (format #f (G_ "\
+Try @option{--list-targets} to view available targets.~%"))))
                      (exit 1))))))))
 
 (define %standard-native-build-options
@@ -409,8 +410,9 @@ (define %standard-native-build-options
                           (format #f (G_ "Did you mean @code{~a}?
 Try @option{--list-systems} to view available system types.~%")
                                   closest))
-                         (display-hint (G_ "\
-Try @option{--list-systems} to view available system types.~%")))
+                         (display-hint
+                          (format #f (G_ "\
+Try @option{--list-systems} to view available system types.~%"))))
                      (exit 1))))))))
 
 \f
-- 
2.37.3


[-- Attachment #3: Type: text/plain, Size: 100 bytes --]


-- 
Retrieve my PGP public key:

  gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC

Zihao

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#57900: [PATCH]: scripts: build: Format strings before calling display-hint.
  2022-09-18  4:31 [bug#57900] [PATCH]: scripts: build: Format strings before calling display-hint Zhu Zihao
@ 2022-09-30 13:53 ` Mathieu Othacehe
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Othacehe @ 2022-09-30 13:53 UTC (permalink / raw)
  To: Zhu Zihao; +Cc: 57900-done


> * guix/scripts/build.scm(%standard-cross-build-options): format hint string.
> %standard-cross-build-options: Ditto.

Applied, thanks!

Mathieu




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-30 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-18  4:31 [bug#57900] [PATCH]: scripts: build: Format strings before calling display-hint Zhu Zihao
2022-09-30 13:53 ` bug#57900: " Mathieu Othacehe

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).