0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/pam: add order comment to each rule line

This commit is contained in:
Majiir Paktu 2023-10-09 22:54:22 -04:00
parent 077cdcc7e9
commit 43f7cb4a95
2 changed files with 5 additions and 3 deletions

View file

@ -597,6 +597,7 @@ let
(map (rule: concatStringsSep " " ( (map (rule: concatStringsSep " " (
[ type rule.control rule.modulePath ] [ type rule.control rule.modulePath ]
++ map formatModuleArgument rule.args ++ map formatModuleArgument rule.args
++ [ "# ${rule.name} (order ${toString rule.order})" ]
))) )))
(concatStringsSep "\n") (concatStringsSep "\n")
]; ];

View file

@ -15,9 +15,10 @@ expected_lines = {
} }
actual_lines = set(machine.succeed("cat /etc/pam.d/chfn").splitlines()) actual_lines = set(machine.succeed("cat /etc/pam.d/chfn").splitlines())
missing_lines = expected_lines - actual_lines stripped_lines = set([line.split("#")[0].rstrip() for line in actual_lines])
extra_lines = actual_lines - expected_lines missing_lines = expected_lines - stripped_lines
non_functional_lines = set([line for line in extra_lines if (line == "" or line.startswith("#"))]) extra_lines = stripped_lines - expected_lines
non_functional_lines = set([line for line in extra_lines if line == ""])
unexpected_functional_lines = extra_lines - non_functional_lines unexpected_functional_lines = extra_lines - non_functional_lines
with subtest("All expected lines are in the file"): with subtest("All expected lines are in the file"):