aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Distribution/Helper.hs18
-rw-r--r--tests/GhcSession.hs4
2 files changed, 6 insertions, 16 deletions
diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs
index 34d7247..0c2fddb 100644
--- a/lib/Distribution/Helper.hs
+++ b/lib/Distribution/Helper.hs
@@ -197,18 +197,12 @@ getProjConfModTime ProjConfV1{pcV1CabalFile} =
[ pcV1CabalFile
]
getProjConfModTime ProjConfV2{..} = do
- mandatory <- mapM getFileModTime $
- [ pcV2CabalProjFile
- ]
- optional <- mapM (traverse getFileModTime <=< mightExist)
- [ pcV2CabalProjLocalFile
- , pcV2CabalProjFreezeFile
- ]
- return $
- ProjConfModTimes $
- mandatory ++
- catMaybes optional
-
+ fmap (ProjConfModTimes . catMaybes) $
+ mapM (traverse getFileModTime <=< mightExist)
+ [ pcV2CabalProjFile
+ , pcV2CabalProjLocalFile
+ , pcV2CabalProjFreezeFile
+ ]
getProjConfModTime ProjConfStack{..} =
fmap ProjConfModTimes $ mapM getFileModTime
[ pcStackYaml
diff --git a/tests/GhcSession.hs b/tests/GhcSession.hs
index 91845d4..f582242 100644
--- a/tests/GhcSession.hs
+++ b/tests/GhcSession.hs
@@ -58,7 +58,6 @@ data CabalCommands pt =
CabalCommands
{ cabalDistDir :: FilePath -> DistDir pt
, cabalProjDir :: FilePath -> ProjLoc pt
- , cabalAddProject :: FilePath -> IO ()
, cabalConfigureCommand :: String
, cabalBuildCommand :: String
, cabalSdistCommand :: String
@@ -68,7 +67,6 @@ oldBuild :: CabalCommands 'V1
oldBuild = CabalCommands
{ cabalDistDir = \d -> DistDirV1 (d </> "dist")
, cabalProjDir = \cf -> ProjLocCabalFile cf
- , cabalAddProject = \_ -> return ()
, cabalConfigureCommand = "configure"
, cabalBuildCommand = "build"
, cabalSdistCommand = "sdist"
@@ -78,7 +76,6 @@ newBuild :: CabalCommands 'V2
newBuild = CabalCommands
{ cabalDistDir = \d -> DistDirV2 (d </> "dist-newstyle")
, cabalProjDir = \cf -> ProjLocV2Dir (takeDirectory cf)
- , cabalAddProject = addCabalProject
, cabalConfigureCommand = "new-configure"
, cabalBuildCommand = "new-build"
, cabalSdistCommand = "sdist"
@@ -123,7 +120,6 @@ runTest c topdir projdir cabal_file act = do
run "cabal" [ cabalSdistCommand c, "-v0", "--output-dir", dir ]
setCurrentDirectory dir
- cabalAddProject c $ dir
run "cabal" [ cabalConfigureCommand c ]
act c $ dir </> takeFileName cabal_file