Skip to content

Commit

Permalink
treewide: Escape backslash in strings properly
Browse files Browse the repository at this point in the history
"\." is apparently the same as "." wheras the correct one is "\\."

(cherry picked from commit 0c368ef)
  • Loading branch information
dezgeg committed Sep 13, 2017
1 parent 9483d16 commit 7d7e967
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nixos/modules/services/misc/geoip-updater.nix
Expand Up @@ -238,15 +238,15 @@ in

assertions = [
{ assertion = (builtins.filter
(x: builtins.match ".*\.(gz|xz)$" x == null) cfg.databases) == [];
(x: builtins.match ".*\\.(gz|xz)$" x == null) cfg.databases) == [];
message = ''
services.geoip-updater.databases supports only .gz and .xz databases.
Current value:
${toString cfg.databases}
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)};
'';
}
];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/idris-modules/default.nix
Expand Up @@ -26,7 +26,7 @@
};

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 (builtins.listToAttrs (map (name: {
inherit name;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/impure.nix
Expand Up @@ -50,7 +50,7 @@ in
# it's a directory, so the set of overlays from the directory, ordered lexicographically
let content = readDir path; in
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))
else
# it's a file, so the result is the contents of the file itself
Expand Down

0 comments on commit 7d7e967

Please sign in to comment.