]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: when comparing versions, show the result 23513/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 25 May 2022 14:00:44 +0000 (16:00 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 25 May 2022 14:02:35 +0000 (16:02 +0200)
In Fedora there was a mixup with versions (the version was prefixed with "v", and
"v251" < "250"). This makes this easier to debug.

src/boot/bootctl.c

index 652667e3309df44479b8a01d824f2d358f21939a..cebb479e75d59a9301b433d9858af8a5d50f104d 100644 (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;
 }