mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] bbu: Emit a message about what happens also when -y is given
@ 2024-02-21 10:33 Uwe Kleine-König
  2024-02-23  7:32 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2024-02-21 10:33 UTC (permalink / raw)
  To: barebox

To inform the user which device is updated using which handler, also
emit a message with -y.

Also update the wording to make the output more similar between the
different cases.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 common/bbu.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/common/bbu.c b/common/bbu.c
index ed41c92f38ec..c34d723086fa 100644
--- a/common/bbu.c
+++ b/common/bbu.c
@@ -95,18 +95,24 @@ int bbu_force(struct bbu_data *data, const char *fmt, ...)
 int bbu_confirm(struct bbu_data *data)
 {
 	int key;
+	const char *prompt;
+
+	if (data->flags & BBU_FLAG_YES)
+		prompt = ".";
+	else
+		prompt = " (y/n)?";
+
+	if (data->imagefile)
+		printf("update barebox on %s from %s using handler %s%s\n",
+			data->devicefile, data->imagefile,
+			data->handler_name, prompt);
+	else
+		printf("Refresh barebox on %s using handler %s%s\n",
+			data->devicefile, data->handler_name, prompt);
 
 	if (data->flags & BBU_FLAG_YES)
 		return 0;
 
-	if (data->imagefile)
-		printf("update barebox from %s using handler %s to %s (y/n)?\n",
-			data->imagefile, data->handler_name,
-			data->devicefile);
-	else
-		printf("Refresh barebox on %s using handler %s (y/n)?\n",
-			data->devicefile, data->handler_name);
-
 	key = read_key();
 
 	if (key == 'y') {

base-commit: ed7c14536d521793199abf0597164a46ba68e8e5
-- 
2.43.0




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

* Re: [PATCH] bbu: Emit a message about what happens also when -y is given
  2024-02-21 10:33 [PATCH] bbu: Emit a message about what happens also when -y is given Uwe Kleine-König
@ 2024-02-23  7:32 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-02-23  7:32 UTC (permalink / raw)
  To: barebox, Uwe Kleine-König


On Wed, 21 Feb 2024 11:33:35 +0100, Uwe Kleine-König wrote:
> To inform the user which device is updated using which handler, also
> emit a message with -y.
> 
> Also update the wording to make the output more similar between the
> different cases.
> 
> 
> [...]

Applied, thanks!

[1/1] bbu: Emit a message about what happens also when -y is given
      https://git.pengutronix.de/cgit/barebox/commit/?id=73ac8b16486f (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2024-02-23  7:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-21 10:33 [PATCH] bbu: Emit a message about what happens also when -y is given Uwe Kleine-König
2024-02-23  7:32 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox