Fix issue where subDir was applied twice (#1004)

This was breaking cleaning of components when a parent dir was needed.

So `hs-source-dirs: x` was ok, `hs-source-dirs: x/y` would fail.
This commit is contained in:
Hamish Mackenzie authored and GitHub committed 2021-01-19 09:38:10 +08:00
1 parent 016daa8c14
commit 06a67e6835
1 file changed
+10 -6
+10 -6
View File
@@ -58,16 +58,20 @@ in
hsSourceDirs = builtins.map (d: combinePaths subDir d) component.hsSourceDirs
++ (if component.hsSourceDirs == [] then [subDir] else []);
includeDirs = builtins.map (d: combinePaths subDir d) component.includeDirs;
dirsNeeded = builtins.map (d: combinePaths subDir d) (
# paths that will be needed (used to check if a parent dir should be included)
dirsNeeded =
# These already include subDir
[dataDir]
++ hsSourceDirs
++ includeDirs
++ package.licenseFiles
++ package.extraSrcFiles
++ component.extraSrcFiles
++ package.extraDocFiles
++ builtins.map (f: dataDir + f) package.dataFiles
++ otherSourceFiles);
++ otherSourceFiles
++ builtins.map (d: combinePaths subDir d) (
# These need the subDir added
package.licenseFiles
++ package.extraSrcFiles
++ component.extraSrcFiles
++ package.extraDocFiles);
fileMatch = dir: list:
let
prefixes = builtins.map (f: combinePaths dir f) (