__GLASGOW_HASKELL__ >= 609 is now always true
[ghc-hetmet.git] / utils / ghc-pkg / Main.hs
index 03a547d..12eaaba 100644 (file)
@@ -30,11 +30,7 @@ import Prelude
 #include "../../includes/ghcconfig.h"
 
 import System.Console.GetOpt
-#if __GLASGOW_HASKELL__ >= 609
 import qualified Control.Exception as Exception
-#else
-import qualified Control.Exception.Extensible as Exception
-#endif
 import Data.Maybe
 
 import Data.Char ( isSpace, toLower )
@@ -1296,6 +1292,9 @@ checkDir warn_only thisfield d
  | "$topdir"     `isPrefixOf` d = return ()
  | "$httptopdir" `isPrefixOf` d = return ()
         -- can't check these, because we don't know what $(http)topdir is
+ | isRelative d = verror ForceFiles $
+                     thisfield ++ ": " ++ d ++ " is a relative path"
+        -- relative paths don't make any sense; #4134
  | otherwise = do
    there <- liftIO $ doesDirectoryExist d
    when (not there) $
@@ -1667,11 +1666,7 @@ openNewFile dir template = do
          -- as any exceptions etc will only be able to report the
          -- fd currently
          h <-
-#if __GLASGOW_HASKELL__ >= 609
               fdToHandle fd
-#else
-              fdToHandle (fromIntegral fd)
-#endif
               `Exception.onException` c_close fd
          return (filepath, h)
       where