diff mbox series

[1/7] Send version string to progress interface

Message ID 20200202133615.23769-1-sbabic@denx.de
State Accepted
Headers show
Series [1/7] Send version string to progress interface | expand

Commit Message

Stefano Babic Feb. 2, 2020, 1:36 p.m. UTC
Send version retrieved from sw-description to progress interface when an
update is started. The string is formatted as:
	VERSION : <version string>

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 core/parser.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/core/parser.c b/core/parser.c
index 74b6a74..38d4973 100644
--- a/core/parser.c
+++ b/core/parser.c
@@ -339,5 +339,14 @@  int parse(struct swupdate_cfg *sw, const char *descfile)
 	 */
 	swupdate_progress_init(count_elem_list(&sw->images));
 
+	/*
+	 * Send the version string as first message to progress interface
+	 */
+	char *versioninfo;
+	if (asprintf(&versioninfo, "VERSION : %s", sw->version) == ENOMEM_ASPRINTF)
+		ERROR("OOM sending version info");
+	else
+		swupdate_progress_info(RUN, 0, versioninfo);
+
 	return ret;
 }