nixos/systemd-boot: fix invalid escape sequences

This was inadvertently introduced in https://github.com/NixOS/nixpkgs/pull/281639, but was not a loud warning until Python 3.12 made invalid escape sequences a `SyntaxWarning` instead of a `DeprecationWarning` in https://github.com/python/cpython/issues/98401.
This commit is contained in:
Mitchell Skaggs 2024-07-07 05:19:37 -05:00
parent f0a074c874
commit 5e1481ccc7
No known key found for this signature in database
GPG Key ID: 4EB0FECB84AE8967

View File

@ -214,8 +214,8 @@ def get_generations(profile: str | None = None) -> list[SystemIdentifier]:
def remove_old_entries(gens: list[SystemIdentifier]) -> None:
rex_profile = re.compile(r"^" + re.escape(BOOT_MOUNT_POINT) + "/loader/entries/nixos-(.*)-generation-.*\.conf$")
rex_generation = re.compile(r"^" + re.escape(BOOT_MOUNT_POINT) + "/loader/entries/nixos.*-generation-([0-9]+)(-specialisation-.*)?\.conf$")
rex_profile = re.compile(r"^" + re.escape(BOOT_MOUNT_POINT) + r"/loader/entries/nixos-(.*)-generation-.*\.conf$")
rex_generation = re.compile(r"^" + re.escape(BOOT_MOUNT_POINT) + r"/loader/entries/nixos.*-generation-([0-9]+)(-specialisation-.*)?\.conf$")
known_paths = []
for gen in gens:
bootspec = get_bootspec(gen.profile, gen.generation)