[project @ 2004-08-27 08:29:04 by simonpj]
[ghc-hetmet.git] / ghc / utils / ghc-pkg / Main.hs
index 29040e4..7eb4f3a 100644 (file)
@@ -29,7 +29,7 @@ import List ( isPrefixOf, isSuffixOf )
 
 import ParsePkgConfLite
 
-#include "../../includes/config.h"
+#include "../../includes/ghcconfig.h"
 
 #ifdef mingw32_HOST_OS
 import Foreign
@@ -84,8 +84,7 @@ copyright = "GHC package manager version " ++ version ++ "\n"
 
 -- hackery to convice cpp to splice GHC_PKG_VERSION into a string
 version :: String
-version = tail "\ 
-   \ GHC_PKG_VERSION"
+version = GHC_PKG_VERSION
 
 usageHeader :: String -> String
 usageHeader prog = "Usage: " ++ prog ++ " [OPTION...]\n"
@@ -256,9 +255,9 @@ checkConfigAccess filename = do
 maybeRestoreOldConfig :: FilePath -> IO () -> IO ()
 maybeRestoreOldConfig filename io
   = my_catch io (\e -> do
-        hPutStr stdout "\nWARNING: an error was encountered while the new \n\ 
-                      \configuration was being written.  Attempting to \n\ 
-                      \restore the old configuration... "
+        hPutStr stdout ("\nWARNING: an error was encountered while the new \n"++
+                         "configuration was being written.  Attempting to \n"++
+                         "restore the old configuration... ")
        renameFile (filename ++ ".old")  filename
         hPutStrLn stdout "done."
        my_throw e
@@ -529,7 +528,7 @@ getExecDir cmd
   where
     len = 2048::Int -- Plenty, PATH_MAX is 512 under Win32.
 
-foreign import stdcall "GetModuleFileNameA" unsafe 
+foreign import stdcall unsafe  "GetModuleFileNameA"
   getModuleFileName :: Ptr () -> CString -> Int -> IO Int32
 #else
 getExecDir :: String -> IO (Maybe String)