1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

bootctl: when comparing versions, show the result

In Fedora there was a mixup with versions (the version was prefixed with "v", and
"v251" < "250"). This makes this easier to debug.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-05-25 16:00:44 +02:00
parent f90ee9ff66
commit 892fcb8955

View File

@ -718,10 +718,13 @@ static int version_check(int fd_from, const char *from, int fd_to, const char *t
to);
r = compare_version(a, b);
log_debug("Comparing versions: \"%s\" %s \"%s", a, comparison_operator(r), b);
if (r < 0)
return log_warning_errno(SYNTHETIC_ERRNO(ESTALE), "Skipping \"%s\", since newer boot loader version in place already.", to);
else if (r == 0)
return log_info_errno(SYNTHETIC_ERRNO(ESTALE), "Skipping \"%s\", since same boot loader version in place already.", to);
return log_warning_errno(SYNTHETIC_ERRNO(ESTALE),
"Skipping \"%s\", since newer boot loader version in place already.", to);
if (r == 0)
return log_info_errno(SYNTHETIC_ERRNO(ESTALE),
"Skipping \"%s\", since same boot loader version in place already.", to);
return 0;
}