aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-04-01 20:40:05 +0200
committerDaniel Gröber <dxld@darkboxed.org>2019-04-01 21:00:45 +0200
commita078ea73f07f95b0e55d13b51c104be749d0ed3d (patch)
tree5f4773ae0c245bc920ebb80be63d9019be1b0912 /lib
parent8111c0d83bb2619a68d72ff5d65e6ae81786b7e5 (diff)
Add ProjLocV1Dir for easier forward porting
Diffstat (limited to 'lib')
-rw-r--r--lib/Distribution/Helper.hs16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs
index d25786c..38f819f 100644
--- a/lib/Distribution/Helper.hs
+++ b/lib/Distribution/Helper.hs
@@ -209,18 +209,20 @@ mkQueryEnv projloc distdir = do
}
-- | Construct paths to project configuration files given where the project is.
-projConf :: ProjLoc pt -> ProjConf pt
-projConf (ProjLocCabalFile cabal_file) =
- ProjConfV1 cabal_file
+projConf :: ProjLoc pt -> IO (ProjConf pt)
+projConf (ProjLocV1Dir pkgdir) =
+ ProjConfV1 <$> findCabalFile pkgdir
+projConf (ProjLocV1CabalFile cabal_file) = return $
+ ProjConfV1 cabal_file
projConf (ProjLocV2Dir projdir_path) =
projConf $ ProjLocV2File $ projdir_path </> "cabal.project"
-projConf (ProjLocV2File proj_file) =
+projConf (ProjLocV2File proj_file) = return $
ProjConfV2
{ pcV2CabalProjFile = proj_file
, pcV2CabalProjLocalFile = proj_file <.> "local"
, pcV2CabalProjFreezeFile = proj_file <.> "freeze"
}
-projConf (ProjLocStackYaml stack_yaml) =
+projConf (ProjLocStackYaml stack_yaml) = return $
ProjConfStack
{ pcStackYaml = stack_yaml }
@@ -313,7 +315,7 @@ checkUpdateProjInfo
-> Maybe (ProjInfo pt)
-> IO (ProjInfo pt)
checkUpdateProjInfo qe mproj_info = do
- let proj_conf = projConf (qeProjLoc qe)
+ proj_conf <- projConf (qeProjLoc qe)
mtime <- getProjConfModTime proj_conf
case mproj_info of
Nothing -> reconf proj_conf mtime
@@ -374,7 +376,7 @@ discardInactiveUnitInfos active_units uis0 =
-- system (@cabal@ or @stack@).
shallowReconfigureProject :: QueryEnvI c pt -> IO ()
shallowReconfigureProject QueryEnv
- { qeProjLoc = ProjLocCabalFile _cabal_file
+ { qeProjLoc = _
, qeDistDir = DistDirV1 _distdirv1 } =
return ()
shallowReconfigureProject QueryEnv