nixos/systemd-boot: fix entry match condition in remove_old_entries

Before this patch, the entry match condition always fails, causing all
entries being removed. The error is not noticed because later they are
re-generated.
This commit is contained in:
Lin Jian 2022-10-07 19:31:43 +08:00
parent 642323930e
commit 437f73dd54
No known key found for this signature in database
GPG Key ID: A6698D36434F75A5

View File

@ -185,9 +185,9 @@ def remove_old_entries(gens: List[SystemIdentifier]) -> None:
if rex_profile.match(path):
prof = rex_profile.sub(r"\1", path)
else:
prof = "system"
prof = None
gen_number = int(rex_generation.sub(r"\1", path))
if not (prof, gen_number) in gens:
if not (prof, gen_number, None) in gens:
os.unlink(path)
except ValueError:
pass