diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2009-05-04 01:54:15 +0200 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2009-05-04 01:54:15 +0200 |
commit | f021ef513a92b2d839a83c55dd1240784fa4a1ce (patch) | |
tree | 2f37e8afd8b7528ae2b5d848b905ba9167539489 | |
parent | 23e4bc1ccd51373c43ea0a2a9643f01cebe0a395 (diff) | |
download | metatile-f021ef513a92b2d839a83c55dd1240784fa4a1ce.tar metatile-f021ef513a92b2d839a83c55dd1240784fa4a1ce.zip |
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
-rw-r--r-- | XMonad/Core.hs | 3 |
1 files changed, 2 insertions, 1 deletions
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 []) |