mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 02:44:30 +00:00
nixos/systemd-boot: correctly find gen_number for specialisation
Before this patch, the gen_number found by regex contains "-specialisation-foo" if specialisation is used. As a result, applying int() to gen_number raises ValueError, causing entries containing a specialisation part not being removed.
This commit is contained in:
parent
e16d04eda7
commit
642323930e
@ -175,7 +175,7 @@ def get_specialisations(profile: Optional[str], generation: int, _: Optional[str
|
||||
|
||||
def remove_old_entries(gens: List[SystemIdentifier]) -> None:
|
||||
rex_profile = re.compile("^@efiSysMountPoint@/loader/entries/nixos-(.*)-generation-.*\.conf$")
|
||||
rex_generation = re.compile("^@efiSysMountPoint@/loader/entries/nixos.*-generation-(.*)\.conf$")
|
||||
rex_generation = re.compile("^@efiSysMountPoint@/loader/entries/nixos.*-generation-([0-9]+)(-specialisation-.*)?\.conf$")
|
||||
known_paths = []
|
||||
for gen in gens:
|
||||
known_paths.append(copy_from_profile(*gen, "kernel", True))
|
||||
|
Loading…
Reference in New Issue
Block a user