[PATCH] bbu: Emit a message about what happens also when -y is given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux