From 9275c3387efa18402674e92dc03da51ae0d41d12 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Tue, 12 Sep 2017 14:50:12 +0300 Subject: [PATCH] lib.cleanSourceFilter: Fix VIM swap file filtering The backslash wasn't properly escaped, and "\." is apparently equal to ".". So it's accidentally filtering out these valid file names (in Nixpkgs): trace: excluding clfswm trace: excluding larswm trace: excluding mkpasswd While at it, turn the file filter stricter to what it was before e2589b3ca22c93029051efcde62aa773fe3085b4. That is, the file name must start with a dot: '.swp', '.foo.swo' are filtered but 'bar.swf' is not. --- lib/sources.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/sources.nix b/lib/sources.nix index 0ec4c020e54..63b3749d19e 100644 --- a/lib/sources.nix +++ b/lib/sources.nix @@ -15,9 +15,10 @@ rec { cleanSourceFilter = name: type: let baseName = baseNameOf (toString name); in ! ( # Filter out Subversion and CVS directories. (type == "directory" && (baseName == ".git" || baseName == ".svn" || baseName == "CVS" || baseName == ".hg")) || - # Filter out backup files. + # Filter out editor backup / swap files. lib.hasSuffix "~" baseName || - builtins.match "^.*\.sw[a-z]$" baseName != null || + builtins.match "^\\.sw[a-z]$" baseName != null || + builtins.match "^\\..*\\.sw[a-z]$" baseName != null || # Filter out generates files. lib.hasSuffix ".o" baseName ||