Permalink
Browse files

Filter autogen files (such as Path_foo) from exposed-modules when run…

…ning sdist. Previously autogen files were only filtered from other-modules.
  • Loading branch information...
1 parent f78a650 commit d273465977a50503ebf4a4625082f1e02cf24132 @stepcut committed Nov 14, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 Cabal/Distribution/Simple/SrcDist.hs
View
12 Cabal/Distribution/Simple/SrcDist.hs
@@ -244,7 +244,7 @@ prepareTree verbosity pkg_descr0 mb_lbi distPref targetDir pps = do
-- pre-processors and include those generated files
case mb_lbi of
Just lbi | not (null pps) -> do
- let lbi' = lbi{ buildDir = targetDir </> buildDir lbi }
+ let lbi' = lbi{ buildDir = targetDir </> buildDir lbi }
withComponentsLBI pkg_descr lbi' $ \c _ ->
preprocessComponent pkg_descr c lbi' True verbosity pps
_ -> return ()
@@ -262,9 +262,13 @@ prepareTree verbosity pkg_descr0 mb_lbi distPref targetDir pps = do
installOrdinaryFile verbosity descFile (targetDir </> descFile)
where
- pkg_descr = mapAllBuildInfo filterAutogenModule pkg_descr0
- filterAutogenModule bi = bi {
- otherModules = filter (/=autogenModule) (otherModules bi)
+ pkg_descr = mapLib filterAutogenModuleLib $ mapAllBuildInfo filterAutogenModuleBI pkg_descr0
+ mapLib f pkg = pkg { library = fmap f (library pkg) }
+ filterAutogenModuleLib lib = lib {
+ exposedModules = filter (/=autogenModule) (exposedModules lib)
+ }
+ filterAutogenModuleBI bi = bi {
+ otherModules = filter (/=autogenModule) (otherModules bi)
}
autogenModule = autogenModuleName pkg_descr0

0 comments on commit d273465

Please sign in to comment.