diff options
author | Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> | 2017-09-12 14:50:12 +0300 |
---|---|---|
committer | Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> | 2017-09-12 14:58:46 +0300 |
commit | 9275c3387efa18402674e92dc03da51ae0d41d12 (patch) | |
tree | f47213535ff612c20d68d59dbefcf400637a3e5e /lib/sources.nix | |
parent | 8f566f4bdefabfcc3529f6163cadf396c1d5a614 (diff) |
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.
Diffstat (limited to 'lib/sources.nix')
-rw-r--r-- | lib/sources.nix | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sources.nix b/lib/sources.nix index 0ec4c020e545..63b3749d19ec 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 || |