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 | bdc0fda9a76efa94f68afab9bb933ce0dcce16aa (patch) | |
tree | 2f37e8afd8b7528ae2b5d848b905ba9167539489 | |
parent | 9b9f065f0a38b1fbe2467b669a79fe4c274d9a30 (diff) | |
download | xmonad-bdc0fda9a76efa94f68afab9bb933ce0dcce16aa.tar.gz xmonad-bdc0fda9a76efa94f68afab9bb933ce0dcce16aa.tar.xz xmonad-bdc0fda9a76efa94f68afab9bb933ce0dcce16aa.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.gz
-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 []) |