From 6c53b98346f2dd3e97fcfe30919362245ffe9745 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sat, 27 Oct 2018 21:05:49 +0200 Subject: Fix getProjConfModTime: allow missing *.project.{local,freeze} files --- lib/Distribution/Helper.hs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/Distribution') diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs index e98427e..97670de 100644 --- a/lib/Distribution/Helper.hs +++ b/lib/Distribution/Helper.hs @@ -196,12 +196,19 @@ getProjConfModTime ProjConfV1{pcV1CabalFile} = fmap ProjConfModTimes $ mapM getFileModTime [ pcV1CabalFile ] -getProjConfModTime ProjConfV2{..} = - fmap ProjConfModTimes $ mapM getFileModTime +getProjConfModTime ProjConfV2{..} = do + mandatory <- mapM getFileModTime $ [ pcV2CabalProjFile - , pcV2CabalProjLocalFile + ] + optional <- mapM (traverse getFileModTime <=< mightExist) + [ pcV2CabalProjLocalFile , pcV2CabalProjFreezeFile ] + return $ + ProjConfModTimes $ + mandatory ++ + catMaybes optional + getProjConfModTime ProjConfStack{..} = fmap ProjConfModTimes $ mapM getFileModTime [ pcStackYaml -- cgit v1.2.3