From patchwork Sun Sep 18 04:31:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Zihao X-Patchwork-Id: 42699 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BAA9F27BBEA; Sun, 18 Sep 2022 05:35:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4314C27BBE9 for ; Sun, 18 Sep 2022 05:35:22 +0100 (BST) Received: from localhost ([::1]:46716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZm1Z-0007EI-9C for patchwork@mira.cbaines.net; Sun, 18 Sep 2022 00:35:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZm1H-0007E5-Np for guix-patches@gnu.org; Sun, 18 Sep 2022 00:35:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48440) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZm1H-0004X8-1J for guix-patches@gnu.org; Sun, 18 Sep 2022 00:35:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZm1G-0002uz-Fz for guix-patches@gnu.org; Sun, 18 Sep 2022 00:35:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57900] [PATCH]: scripts: build: Format strings before calling display-hint. Resent-From: Zhu Zihao Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 18 Sep 2022 04:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57900 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57900@debbugs.gnu.org X-Debbugs-Original-To: guix-patches Received: via spool by submit@debbugs.gnu.org id=B.166347567711180 (code B ref -1); Sun, 18 Sep 2022 04:35:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 Sep 2022 04:34:37 +0000 Received: from localhost ([127.0.0.1]:47518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZm0q-0002uF-L4 for submit@debbugs.gnu.org; Sun, 18 Sep 2022 00:34:37 -0400 Received: from lists.gnu.org ([209.51.188.17]:49546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZm0l-0002u5-U8 for submit@debbugs.gnu.org; Sun, 18 Sep 2022 00:34:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZm0l-0007DY-Po for guix-patches@gnu.org; Sun, 18 Sep 2022 00:34:31 -0400 Received: from mail-m973.mail.163.com ([123.126.97.3]:54043) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZm0g-0004UI-97 for guix-patches@gnu.org; Sun, 18 Sep 2022 00:34:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=fD0vG DFEuMbJF6pb+HvIdxFTW9/58FE7eF/sKHzRiN8=; b=ZJlr5ohZV9QTn6XXoMWID gCncrzHXaqZqxD/0ZETm4FzbYAJILlTeS8/7bZEihm6NR+QDIlZwXjb29MbKdUdX NgOspEFElGuBpHnccz/BopMmzuSaggY5hZJ3ttzM5Uuq1abyRdfNm2jQhraDQ3xJ MvanRuo+QnRZE0YAVuTR1I= Received: from asus-laptop (unknown [27.38.249.219]) by smtp3 (Coremail) with SMTP id G9xpCgAXlHXEnyZj6D6Weg--.58164S2; Sun, 18 Sep 2022 12:34:14 +0800 (CST) User-agent: mu4e 1.8.9; emacs 29.0.50 From: Zhu Zihao Date: Sun, 18 Sep 2022 12:31:02 +0800 Message-ID: <86y1uhuwqp.fsf@163.com> MIME-Version: 1.0 X-CM-TRANSID: G9xpCgAXlHXEnyZj6D6Weg--.58164S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrAr13Cr47Zw45Jw47Cw4fGrg_yoWxWFXEkr Z3t3Z5Wry5AFn7WanYva4rGryfKwn3tF18KrnIvw1Yy34kZ3Z7WayDZr97Z3WfAFWSq3W7 Zr98tF9rWr1SkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUjeHq3UUUUU== X-Originating-IP: [27.38.249.219] X-CM-SenderInfo: pdoosuxxwbztlvw6il2tof0z/xtbBoQaAr2I0UxvalgAAsa Received-SPF: pass client-ip=123.126.97.3; envelope-from=all_but_last@163.com; helo=mail-m973.mail.163.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 From 13b4f55dc1f21a8ca15329d493f441d09df0ab4e Mon Sep 17 00:00:00 2001 From: Zhu Zihao 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)))))))) -- 2.37.3