]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix if check in install_systemd_boot()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 15 Sep 2025 11:55:42 +0000 (13:55 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 15 Sep 2025 11:55:42 +0000 (13:55 +0200)
A generator object always evaluates to True, we have to wrap it with
any() to check if it contains anything.

mkosi/bootloader.py

index d308a4133b7e69e10abe929caa95b168135ee9be..7e890c614518d499e7562f50aa5bf1c8ab485428 100644 (file)
@@ -664,7 +664,7 @@ def install_systemd_boot(context: Context) -> None:
 
     directory = context.root / "usr/lib/systemd/boot/efi"
     signed = context.config.bootloader.is_signed()
-    if not directory.glob("*.efi.signed" if signed else "*.efi"):
+    if not any(directory.glob("*.efi.signed" if signed else "*.efi")):
         if context.config.bootable == ConfigFeature.enabled:
             die(
                 f"An EFI bootable image with systemd-boot was requested but a {'signed ' if signed else ''}"