Filtering problematic packages.

This commit is contained in:
Kazu Yamamoto 2013-09-11 14:09:18 +09:00
parent 024b6b3200
commit 5750673e0e

View File

@ -51,13 +51,21 @@ cookInfo ghcOptions cradle cabal = (gopts,idirs,depPkgs)
buildInfos = cabalAllBuildInfo cabal buildInfos = cabalAllBuildInfo cabal
gopts = getGHCOptions ghcOptions $ head buildInfos gopts = getGHCOptions ghcOptions $ head buildInfos
idirs = includeDirectories cdir wdir $ cabalAllSourceDirs buildInfos idirs = includeDirectories cdir wdir $ cabalAllSourceDirs buildInfos
depPkgs = removeMe cfile $ cabalAllDependPackages buildInfos depPkgs = removeThem problematicPackages $ removeMe cfile $ cabalAllDependPackages buildInfos
removeMe :: FilePath -> [String] -> [String] removeMe :: FilePath -> [String] -> [String]
removeMe cabalfile = filter (/= me) removeMe cabalfile = filter (/= me)
where where
me = dropExtension $ takeFileName cabalfile me = dropExtension $ takeFileName cabalfile
removeThem :: [String] -> [String] -> [String]
removeThem badpkgs = filter (`notElem` badpkgs)
problematicPackages :: [String]
problematicPackages = [
"base-compat" -- providing "Prelude"
]
includeDirectories :: String -> String -> [FilePath] -> [String] includeDirectories :: String -> String -> [FilePath] -> [String]
includeDirectories cdir wdir [] = uniqueAndSort [cdir,wdir] includeDirectories cdir wdir [] = uniqueAndSort [cdir,wdir]
includeDirectories cdir wdir dirs = uniqueAndSort (map (cdir </>) dirs ++ [cdir,wdir]) includeDirectories cdir wdir dirs = uniqueAndSort (map (cdir </>) dirs ++ [cdir,wdir])