treewide: Escape backslash in strings properly
"\." is apparently the same as "." wheras the correct one is "\\."
This commit is contained in:
parent
62711f4265
commit
0c368ef02f
@ -238,7 +238,7 @@ in
|
|||||||
|
|
||||||
assertions = [
|
assertions = [
|
||||||
{ assertion = (builtins.filter
|
{ assertion = (builtins.filter
|
||||||
(x: builtins.match ".*\.(gz|xz)$" x == null) cfg.databases) == [];
|
(x: builtins.match ".*\\.(gz|xz)$" x == null) cfg.databases) == [];
|
||||||
message = ''
|
message = ''
|
||||||
services.geoip-updater.databases supports only .gz and .xz databases.
|
services.geoip-updater.databases supports only .gz and .xz databases.
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ in
|
|||||||
${toString cfg.databases}
|
${toString cfg.databases}
|
||||||
|
|
||||||
Offending element(s):
|
Offending element(s):
|
||||||
${toString (builtins.filter (x: builtins.match ".*\.(gz|xz)$" x == null) cfg.databases)};
|
${toString (builtins.filter (x: builtins.match ".*\\.(gz|xz)$" x == null) cfg.databases)};
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
files = builtins.filter (n: n != "default") (pkgs.lib.mapAttrsToList (name: type: let
|
files = builtins.filter (n: n != "default") (pkgs.lib.mapAttrsToList (name: type: let
|
||||||
m = builtins.match "(.*)\.nix" name;
|
m = builtins.match "(.*)\\.nix" name;
|
||||||
in if m == null then "default" else builtins.head m) (builtins.readDir ./.));
|
in if m == null then "default" else builtins.head m) (builtins.readDir ./.));
|
||||||
in (builtins.listToAttrs (map (name: {
|
in (builtins.listToAttrs (map (name: {
|
||||||
inherit name;
|
inherit name;
|
||||||
|
@ -50,7 +50,7 @@ in
|
|||||||
# it's a directory, so the set of overlays from the directory, ordered lexicographically
|
# it's a directory, so the set of overlays from the directory, ordered lexicographically
|
||||||
let content = readDir path; in
|
let content = readDir path; in
|
||||||
map (n: import (path + ("/" + n)))
|
map (n: import (path + ("/" + n)))
|
||||||
(builtins.filter (n: builtins.match ".*\.nix" n != null || pathExists (path + ("/" + n + "/default.nix")))
|
(builtins.filter (n: builtins.match ".*\\.nix" n != null || pathExists (path + ("/" + n + "/default.nix")))
|
||||||
(attrNames content))
|
(attrNames content))
|
||||||
else
|
else
|
||||||
# it's a file, so the result is the contents of the file itself
|
# it's a file, so the result is the contents of the file itself
|
||||||
|
Loading…
Reference in New Issue
Block a user