* [PATCH] Fix print messages
@ 2012-06-26 18:04 Yves Blusseau
2012-06-26 20:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-06-26 21:45 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 2 replies; 3+ messages in thread
From: Yves Blusseau @ 2012-06-26 18:04 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1.1: Type: text/plain, Size: 165 bytes --]
Hi,
The attached patch fixes the printing of help messages on platform that have a shell that don't support the -n option in the built-in echo command.
Yves.
[-- Attachment #1.2: fix-print-messages.patch --]
[-- Type: application/octet-stream, Size: 1777 bytes --]
From d6a7b168c9c247c126ebd6debf80e41b903624c0 Mon Sep 17 00:00:00 2001
From: Yves Blusseau <blusseau@zetam.org>
Date: Tue, 26 Jun 2012 19:51:55 +0200
Subject: [PATCH] * util/grub-mkconfig_lib.in: fix print messages
replacing builtin echo shell command by printf command.
---
ChangeLog | 5 +++++
util/grub-mkconfig_lib.in | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e908136..31e29a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-26 Yves Blusseau <blusseau@zetam.org>
+
+ * util/grub-mkconfig_lib.in: fix print messages replacing builtin
+ echo shell command by printf command.
+
2012-06-26 Vladimir Serbinenko <phcoder@gmail.com>
Apple fixes.
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 2b887b1..8f602e9 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -35,7 +35,7 @@ if which gettext >/dev/null 2>/dev/null; then
:
else
gettext () {
- echo -n "$@"
+ printf "%s" "$@"
}
fi
@@ -308,14 +308,14 @@ print_option_help () {
print_option_help_lead=" $1"
print_option_help_lspace="$(echo "$print_option_help_lead" | wc $print_option_help_wc)"
print_option_help_fill="$((26 - print_option_help_lspace))"
- echo -n "$print_option_help_lead"
+ printf "%s" "$print_option_help_lead"
if test $print_option_help_fill -le 0; then
print_option_help_nl=y
echo
else
print_option_help_i=0;
while test $print_option_help_i -lt $print_option_help_fill; do
- echo -n " "
+ printf "%s" " "
print_option_help_i=$((print_option_help_i+1))
done
print_option_help_nl=n
--
1.7.10.2
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 1869 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Fix print messages
2012-06-26 18:04 [PATCH] Fix print messages Yves Blusseau
@ 2012-06-26 20:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-06-26 21:45 ` Vladimir 'φ-coder/phcoder' Serbinenko
1 sibling, 0 replies; 3+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-06-26 20:40 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 510 bytes --]
On 26.06.2012 20:04, Yves Blusseau wrote:
> Hi,
>
> The attached patch fixes the printing of help messages on platform that have a shell that don't support the -n option in the built-in echo command.
>
Other than the bad capitalisation in log entry, go ahead.
> Yves.
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix print messages
2012-06-26 18:04 [PATCH] Fix print messages Yves Blusseau
2012-06-26 20:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-06-26 21:45 ` Vladimir 'φ-coder/phcoder' Serbinenko
1 sibling, 0 replies; 3+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-06-26 21:45 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 214 bytes --]
On 26.06.2012 20:04, Yves Blusseau wrote:
> - echo -n " "
> + printf "%s" " "
No need for extra indirection here
printf " " should be fine.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-26 21:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-26 18:04 [PATCH] Fix print messages Yves Blusseau
2012-06-26 20:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-06-26 21:45 ` Vladimir 'φ-coder/phcoder' Serbinenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.