summaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorDon Stewart <dons@galois.com>2007-11-19 02:15:28 +0100
committerDon Stewart <dons@galois.com>2007-11-19 02:15:28 +0100
commite23b5ce3cb62232f2c8ff8a8e57dc84db241bc7f (patch)
treefb37ffccd6b70847e2e99c597b14a664c3f15f48 /XMonad
parent393b2c8edd247612c52d2422165516342c72c94a (diff)
downloadmetatile-e23b5ce3cb62232f2c8ff8a8e57dc84db241bc7f.tar
metatile-e23b5ce3cb62232f2c8ff8a8e57dc84db241bc7f.zip
only check xmonad.hs against the xmonad binary, not the .o file (meaning you can remove it if you like)
darcs-hash:20071119011528-cba2c-a78aa9afca0a09be2e25c784b0bb6b55f94da3d0
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Core.hs14
1 files changed, 8 insertions, 6 deletions
diff --git a/XMonad/Core.hs b/XMonad/Core.hs
index 90bfd9a..5ea2d03 100644
--- a/XMonad/Core.hs
+++ b/XMonad/Core.hs
@@ -297,16 +297,18 @@ restart mprog resume = do
-- The -i flag is used to restrict recompilation to the xmonad.hs file.
-- Raises an exception if GHC can't be found, or if anything else goes wrong.
--
+-- The file is only recompiled if it is newer than its binary.
+--
recompile :: IO ()
recompile = do
- dir <- liftM (++ "/.xmonad") getHomeDirectory
- let src = dir ++ "/" ++ "xmonad.hs"
- obj = dir ++ "/" ++ "xmonad.o"
- yes <- doesFileExist src
+ dir <- liftM (++ "/.xmonad") getHomeDirectory
+ let bin = dir ++ "/" ++ "xmonad"
+ src = bin ++ ".hs"
+ yes <- doesFileExist src
when yes $ do
srcT <- getModificationTime src
- objT <- getModificationTime obj
- when (srcT > objT) $ do
+ binT <- getModificationTime bin
+ when (srcT > binT) $ do
waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i"] (Just dir)
Nothing Nothing Nothing Nothing
return ()