From bdc0fda9a76efa94f68afab9bb933ce0dcce16aa Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Mon, 4 May 2009 01:54:15 +0200 Subject: Only watch mtime for .hs, .lhs, .hsc for ~/.xmonad/lib Ignore-this: e3b1847edf3e07a8182f7fcfc23b00c8 Previously xmonad would force a recompile due to the object files being too new, so only look at files which may contain haskell code. darcs-hash:20090503235415-1499c-50100b58df81d6e0506bbaf937b476a018064271.gz --- XMonad/Core.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/XMonad/Core.hs b/XMonad/Core.hs index c5aeef8..be366cd 100644 --- a/XMonad/Core.hs +++ b/XMonad/Core.hs @@ -412,7 +412,7 @@ recompile force = io $ do err = base ++ ".errors" src = base ++ ".hs" lib = dir "lib" - libTs <- mapM getModTime =<< allFiles lib + libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib srcT <- getModTime src binT <- getModTime bin if (force || srcT > binT || any (binT<) libTs) @@ -440,6 +440,7 @@ recompile force = io $ do return (status == ExitSuccess) else return True where getModTime f = catch (Just <$> getModificationTime f) (const $ return Nothing) + isSource = flip elem [".hs",".lhs",".hsc"] allFiles t = do let prep = map (t) . Prelude.filter (`notElem` [".",".."]) cs <- prep <$> catch (getDirectoryContents t) (\_ -> return []) -- cgit v1.2.3